简体   繁体   中英

Ember.js rendering slow in IE 7

We created a web application using EmberJS (version 1.0.0-rc5). We notice great performance in Chrome, unfortunately we have to support Internet Explorer 7 as our main platform.

We notice that performance on IE7 is terrible. After investigating the issue, it boils down to the rendering of the template (although routing is also terribly slow). We have no clue if this is due to a mistake in the way we built our application or if this is a problem with Ember.

I created a small sample app to reproduce the problem. You can find it at http://manoswerts.be/playground/ember-performance . It renders a tree similar to what we do in our app. When running it in Chrome, the result shows instantly. In IE7 it takes between 30 seconds up to a minute to render. In IE8 it "only" takes 7 seconds.

Is anyone familiar with this? Is there a solution to this problem?

Any help is greatly appreciated.

Try adding the following to get some more detail about what is taking so long:

Ember.subscribe('render', {
  before: function(name, start, payload){
    return start;
  },
  after: function(name, end, payload, start){
    var duration = Math.round(end - start);
    var template = payload.template || '';
    //console.log(Ember.inspect(payload));
    //var title;
    var view = payload.object.toString();
    console.log('rendered', template, view, 'took', duration, 'ms');
  }
});

This will give you timings for every view that is rendered. When I run your example in Chrome each of person templates take about 2ms to render. There is also some overhead related to the nested {{each}} helpers and rendering the "virtual" views within those {{each}} blocks. In total the list render time is 104ms. That total time will be the last console.log line written after you hit the Show results button.

So based on what you're saying I would expect that total time to be an order-of-magnitude slower for ie7 and ie8. If that's the case, wondering if that is distributed evenly or is there a specific view that renders much more slowly.

For both IE7 and IE8 it is take same time for me, around 4-5 seconds.

Other ember js sample app

https://github.com/dgeb/ember_data_example

not working at all with IE7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM