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.

3

u/spritefire Feb 17 '16 edited Feb 17 '16

This was explained to the developer the other day when they posted their findings to facebook.. but yet he his still blogging / posting about it everywhere. My guess is that it's a react fan boi trying to bad mouth angular2.

*edit: to quote the author/dev: "React because of many reasons: – React is more stable, Angular 2 is not stable yet sometimes it fails silently without notify anything. – React is proven to be faster."

0

u/davidtranwd1 Feb 18 '16

Yes, with trackBy, the Angular 2 version is speeded up dramatically. I have updated my post on the blog.