The power of OnPush change detection strategy

Hi all, I just wanted to share a real-life example of how the #Angular #onPush strategy can positively affect app performance. A friend of mine asked for help profiling a component with a table that rendered 150+ items. The entire logic was implemented within a single component, which made the UI completely unresponsive. After splitting the rendering logic into smaller components and using the onPush strategy, the performance drastically improved. Further optimization is still possible, but this example illustrates what can be achieved with just a little effort - a 5x performance boost and no frame drops.

If you wish to dive deeper, I suggest watching the video by Minko Gechev its a 3 years old, but completely relevant nowadays. https://www.youtube.com/watch?v=FjyX_hkscII

A component using a default strategy


A component using onPush strategy


要查看或添加评论,请登录

社区洞察

其他会员也浏览了