Menu

Thirty-four of our 38 pages ship the same 895,384 characters of JavaScript, and a third of it runs
📰

Thirty-four of our 38 pages ship the same 895,384 characters of JavaScript, and a third of it runs

DEV Community: nextjs·Daniel Pertu·6 days ago
#by6JqA0N
#devtonextjs#devto#dev#pages#cent
Long article (1248 words) — no AI summary yet.
Reading 0:00
15s threshold

notifio.app is a marketing site for a desktop app. Thirty-eight pages, almost all of them prose: a comparison page, a guide about how fast rental listings go , a page per listing site. A while back I measured what one of those pages downloads and found 1 MB of JavaScript on a page of static text , most of it the error reporter.

That post weighed the bytes. It never asked whether they run. This one does, on all 38 pages at once.

The instrument

V8 has a precise coverage mode, which Playwright exposes directly. It reports, per script, the byte ranges that were entered:

await page . coverage . startJSCoverage ( { reportAnonymousScripts : false } ) ; await page . goto ( url , { waitUntil : 'load' } ) ; await page . waitForLoadState ( 'networkidle' ) ; await new Promise ( r => setTimeout ( r , 2500 ) ) ; const coverage = await page . coverage . stopJSCoverage ( ) ;

Enter fullscreen mode

Exit fullscreen mode

Each entry carries source and a list of functions, each with ranges and a hit count.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.