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

  • What a byte of JavaScript costsBeginner · 31 min read · Sign in to read

    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.

  • Code splitting and loading on demandIntermediate · 32 min read · Sign in to read

    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.

  • Long tasks and responsive inputIntermediate · 42 min read · Sign in to read

    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.

  • Moving work off the main threadAdvanced · 35 min read · Sign in to read

    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.