r/angularjs • • Feb 17 '16

Is Angular 2 is faster ?

http://jslancer.com/2016/02/15/is-angular-2-is-faster/
10 Upvotes

16 comments sorted by

View all comments

12

u/EmptyTon Feb 17 '16

The Angular 2 version gets significantly faster with trackBy support. https://github.com/angular/angular/pull/6779

When profiling with the chrome devtools timeline I get

VersionJS timeLayout time
Angular 165 ms75 ms
Angular 2 original210 ms60 ms
Angular 2 trackBy27 ms45 ms

2

u/PerfectlyCromulent Feb 18 '16

Turns out it's even faster than trackBy to just wrap the name in an object: https://plnkr.co/edit/3yUoQyzzFfIuF6OTn8wq.

Edit: faster on my Windows 10 desktop running Chrome 48, that is. YMMV. I was seeing ~36ms per interval of JS time for the trackBy version and ~24ms per interval for the object wrapper version.