0

I was reading this blog:

http://eviltrout.com/2013/02/10/why-discourse-uses-emberjs.html

The Run Loop

One of the more complicated pieces of EmberJS is the run loop. Usually you aren’t aware of it, but behind the scenes Ember batches up updates to the DOM and bindings for performance. In some other frameworks if you have a list of 100 items, and iterate through them changing them all, you will end up with 100 separate DOM updates. Ember will batch them and update all at once, providing a better user experience.

And it mentions this angular problem. Is this true? Are there any ways to mitigate this? From the sounds of it if this is the case then angular can be quite behind performance wise?

4

1 回答 1

2

AngularJS 也有类似 runloop 的东西。他们处理绑定的方式是通过dirtychecking。一种也用于(要求苛刻的)3d 视频游戏的技术。想法是,使用这种方法,AngularJS 将能够为包含多达 2000 个元素的 gui 提供流畅的体验和快速响应(<50 毫秒)(更多意味着你的 gui 在 Angular 看来包含太多信息)。也就是说,Angular 很快就会在较新的浏览器中开始使用 Object.observe() 功能。

你可以在这里阅读:http: //blog.angularjs.org/2012/07/angularjs-10-12-roadmap.html

Object.observe() prototype (replace our dirty checking with O.o() )

这意味着 Angular 将用我认为对于这个问题的最佳性能来代替它的脏检查。优点是您可以使用不太复杂的设置(在 EmberJS 中,您必须使用 Ember.set() 和 .get() 方法。这将不再是必需的。

您的选择将归结为想要支持较旧的浏览器(EmberJS 支持),以获得在 gui 中支持大量元素的功能。

于 2013-02-11T11:34:10.283 回答