Menu

Half the JavaScript on our static FAQ page never runs, and 98 KB of it is the framework's server code
📰

Half the JavaScript on our static FAQ page never runs, and 98 KB of it is the framework's server code

DEV Community: javascript·Daniel Pertu·8 days ago
#H051p1T1
#devtojavascript#devto#dev#cent#coverage
Reading 0:00
15s threshold

Our FAQ page is prerendered. It has no form, no widget, no video, and nothing on it changes after it paints. It references 19 JavaScript chunks, 18 of which the browser actually fetches.

Earlier today I counted how many of the stylesheet's rules match anything on that page: 213 of 1,250 . This is the same question asked of the JavaScript, with the instrument that does work for JavaScript: V8 precise coverage.

The number

Over CDP: Profiler.enable , Profiler.startPreciseCoverage({ detailed: true }) , navigate, wait five seconds, Profiler.takePreciseCoverage .

/faq 18 chunks 1,131,567 chars 545,968 executed 48.2% /compare/kahoot-for-pub-quiz 18 1,131,567 545,314 48.2% /pricing 19 1,135,478 549,798 48.4% /tools/round-planner 19 1,141,353 555,675 48.7% /legal/privacy 13 851,085 440,924 51.8%

Enter fullscreen mode

Exit fullscreen mode

Two repeat runs of the FAQ page gave 49.4 and 49.5 per cent, so call it "about half" rather than 48.2 exactly.…

Continue reading — create a free account

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