4 ms·
While it's nice that Ember.js provides a run loop that's not enough, just batching all your updates into one place just puts all of the work together, you'll st
by swannodette 13y ago
While it's nice that Ember.js provides a run loop that's not enough, just batching all your updates into one place just puts all of the work together, you'll still going to pay for the work and in the worse case you have to hand coalesce, yuck. In Om if there is no work ... there is no work, it's implicit in the system! No need for hand coalescing your state changes.
Angular.js still suffers as shown by the optimization article I linked to in my post. These kinds of typical optimizations can and should be pushed out of the user's hands.
- ef4 13y agoYou're misunderstanding. There's no hand coalescing in Ember, and there's no duplicate work. If you change your models a thousand times in a row, you still get one redraw, fully automatically. The same holds for dependent computed properties. If you change a dependencies many times in a row, the dependent property only reevaluates once.
- swannodette_ 13y agoIf that's really true for Ember.js that's great! I'm curious as to why it performs so badly? http://www.petehunt.net/react/tastejs/benchmark.html http://www.petehunt.net/react/tastejs/benchmark.html
- EvilTrout 13y agoI looked at that benchmark and there's a few huge red flags right away: 1. It's not running Ember in production mode which is much faster. 2. It's running an older release candidate version of Ember. 3. It is purposely wrapping individual events in run loop executions rather than just letting ember figure out when you put things into run loops. I re-ran the benchmarks with the latest production mode Ember.js and removed the incorrect run loop usage got the following results: https://gist.github.com/eviltrout/8058560 https://gist.github.com/eviltrout/8058560 It's still slower than ReactJS but much less so than before. In fact it's now #3 in that benchmark suite behind ReactJS and Backbone (and much faster than ReactJS in the completing benchmark), although I wouldn't be surprised if the other frameworks were set up as incorrectly too.
- swannodette 13y agoThanks for the clarifications!