05 Mar 2015, 10:37

ng-conf 2015: Immutable data structures

I’m watching ng-conf live from home today cause I wasn’t able to go with the guys from work (which is a story in itself; not an interesting one, though), and so far the most exciting thing I’ve seen was in the keynote about Angular 2 by Brad Green and Igor Minar.

They mentioned that the Angular 2 team has taken advantage of ECMAScript 6 immutable data structures in order to vastly improve performance. If you’re unfamiliar with ES6 immutable data structures, they are implemented with the const keyword:

const x = 'this string cannot be modified';

Angular 2 will take advantage of this in order to enhance performance, with stunning results:

image image image

As you can see from the third screenshot, if your context allows you to get away with using immutable data, Angular 2 will drop your table rendering to O(1), decoupled from the number of tables!

Of course, my excitement should probably be more directed toward the ES6 specification, but kudos to the Angular team as well for taking advantage!