Performance and optimization · The price of script
JavaScript performance-style app
Illustrative system design for a the price of script app like JavaScript performance: 4 topics to read, from requirements to deep dives.
Illustrative design, not JavaScript performance’s actual implementation. Arrowbox is not affiliated with JavaScript performance’s owner. Disclaimer
Start with Bundle cost Sign in to start readingUpdated 2 Oct 2026
Core
JavaScript is paid for three times: download, parse and compile, then execution; on slow phones the last two dominate, so trimming dependencies beats only compressing.
Split the bundle by route and by interaction with dynamic import, so the first screen ships only its own code and the rest arrives when the user heads for it.
A task over 50 ms can leave a tap unanswered; INP reports about the slowest tap or key-to-paint of a visit, and feedback first plus yielding keeps it under 200 ms.
A dedicated worker runs script on another thread; messages are copied by structured clone unless you transfer buffers, so it pays off for heavy, self-contained work like parsing or search indexing.