为什么Angular 2的性能优于Angular 1?

Jus*_*Pup 7 performance angular

精彩的开发人员,我需要一些帮助来澄清为什么Angular 2比Angular 1更具性能?

在搜索网络后,我在Quora讨论中提出了Er Shahbaz Sharif的相关解释:

Angular 2 is using Hierarchical Dependency Injection system which is major performance booster. 
Angular 2 implements unidirectional tree based change detection which again increases performance . 
As per ng-conf meetup, angular 2 is 5 times faster as compared to angular 1
Run Code Online (Sandbox Code Playgroud)

同一讨论中的其他解释似乎也在此围绕.

有人可以为我澄清为什么这两个因素(以及其他因素,如果有的话)有助于提升Angular 2的性能?非常感谢..

Gün*_*uer 3

Angular2 - 不进行深度对象比较。如果向数组添加项目或从数组中删除项目,则更改检测不会检测到它。对于对象属性来说也是如此,只要它们不直接从视图绑定即可。

  • 双向绑定被分为仅将检测到的变化从根传播到叶子。

  • 从子级到父级的更改仅通过显式事件(输出)传播,并且仅传播到直接父级。

  • 当输入值没有更改时,ChangeDetectionStrategy.OnPush 不会对组件运行更改检测。这会修剪根本不运行更改检测的组件的子树。

  • 代码(尤其是变更检测代码)的编写方式可以被 JS VM 尽可能地优化。

https://www.quora.com/AngularJS 和 Angular2 之间的差异是什么