Vitals 101
Vitals 101
@CoreVitals101

One listener instead of 200 took INP from 290ms to 110ms

INP — Interaction to Next Paint — measures click responsiveness. A hidden cost: attaching a separate click-listener to hundreds of items. Each one uses memory and slows the page's reaction. Think of it like giving every guest their own doorbell instead of one for the house.

A table with 200 rows attached a click handler to every row, so clicks lagged and INP sat at 290ms.

The fix was 'event delegation' — one listener on the parent that figures out which row was clicked:

— Removed 200 individual listeners.
— Added 1 listener on the table container.
— It reads which row fired the click and acts on it.

Result: INP dropped to 110ms, and the page used less memory too.

Try this: if you attach listeners in a loop, one parent listener often does the same job faster.
This post was published in the Telegram channel Vitals 101 (@CoreVitals101). All its posts are on the channel page.
Open on Telegram

Latest posts in “Tools and infrastructure”

All channels in this category →

реклама в сети

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.