← Back

Tweeted on 19 Aug 2019

Last week I learned how to use the performance tab in the Chrome DevTools and relearned the value of avoiding dynamically retrieving data that you filter, map or whatever. As a dev you probably have a machine that can handle this without breaking a sweat. Your users don’t.

With dynamically retrieving data I mean calling a method from your template, your HTML, that gets a subset of the available data by filtering for example. Frameworks like Angular fire this constantly because they keep detecting changes and want to repaint the DOM.

It’s better to put that subset into a variable when the component is initialised or explicitly fire a method to do that (again) when necessary.