Member-only story

The right way to measure your JS performances

Two ways of measuring your application performance and when to use them

Rémy Villulles
2 min readJan 16, 2022
Photo by Chris Peeters from Pexels

Introduction

Measuring performance is an important part of delivering a good experience for the user and keeping an eye on potential bottlenecks.

There are multiple ways to measure the performance of your application and they depend on the objective that you have.

This article is using only vanilla Javascript and is not talking about potential external libraries

Analytics

The first objective could be for analytic purposes. You’re having an application running in production and you would like to keep an eye on the duration of specific operations by logging those results into a database.

To do so, we can use a module called Performance .

How does it work

Performance is a pretty straightforward module to use.

It doesn’t need any import as it’s embedded in JS. It also works on most recent browsers and recent versions of NodeJS.

You first of all need to mark the beginning and end of your operation.
To do so, you can use performance.mark("markName") at the beginning and at the…

--

--

Rémy Villulles
Rémy Villulles

Written by Rémy Villulles

Fullstack developer, I love learning new technologies and try to stay up to date with the newest features

No responses yet