Measuring the time it takes to execute a function is always a good idea to prove that some implementation is more performant than the other. It’s also a good way to ensure that performance didn’t suffer after some change and to track down bottlenecks.

Good performance contributes to a good user experience. And a good user experience makes users come back. This research for example shows, 88% of online consumers are less likely to return after a poor user experience due to performance issues.

That’s why it’s important to be able to recognize bottlenecks in your code and measure the improvements. Especially when developing JavaScript for the browser it’s important to be aware that every line of JavaScript you write can potentially block the DOM since it’s a single-threaded language.

In this article, I will explain how you can measure the performance of your functions and what to do with the results, you get from them.

#performance #javascript

Measuring the Performance of JavaScript Functions
2.80 GEEK