Using immutable data structures to optimize Angular change detection
Hakulinen, Roope Verneri (2018)
Hakulinen, Roope Verneri
2018
Tietotekniikka
Tieto- ja sähkötekniikan tiedekunta - Faculty of Computing and Electrical Engineering
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2018-06-06
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tty-201806011902
https://urn.fi/URN:NBN:fi:tty-201806011902
Tiivistelmä
Angular is the successor of the extremely popular Angular.js framework. While it is based on many of the same concepts, it still is a complete rewrite of Angular.js. Angular has an extremely interesting approach to change detection which differs quite a lot from what other libraries and frameworks have implemented. While extremely performant already by default, it can still be fine-tuned by the developer.
The target of this thesis was to introduce the optimization possibility related to the usage of immutable data structures and the OnPush change detection strategy and to demonstrate the performance gain with a reference application. The reference application built is a complete Angular application. It demonstrates a change detection heavy use case where the original version is suffering from a minor performance problem.
It was proven that the usage of immutable data structures with the OnPush change detection strategy can have a great positive impact on the performance of an Angular application. The actual gain is dependent on the architecture of the application. In the case of the reference application the gain was 1.21648-fold in frames per seconds compared to unoptimized version.
The target of this thesis was to introduce the optimization possibility related to the usage of immutable data structures and the OnPush change detection strategy and to demonstrate the performance gain with a reference application. The reference application built is a complete Angular application. It demonstrates a change detection heavy use case where the original version is suffering from a minor performance problem.
It was proven that the usage of immutable data structures with the OnPush change detection strategy can have a great positive impact on the performance of an Angular application. The actual gain is dependent on the architecture of the application. In the case of the reference application the gain was 1.21648-fold in frames per seconds compared to unoptimized version.