Assess JavaScript payload size and its parse and execution cost.
Compression reduces transfer time but not parse time, because the engine works on the expanded code. That is why bundle size matters twice, and why the parse cost dominates on mobile. JavaScript is byte-for-byte the most expensive resource type, costing far more per kilobyte than images because it must be parsed and executed as well as downloaded.
JavaScript Payload
Cost = compressed size ÷ bandwidth + uncompressed size ÷ parse rate × CPU throttle
Cost = compressed size ÷ bandwidth + uncompressed size ÷ parse rate × CPU throttle Compression reduces transfer time but not parse time, because the engine works on the expanded code. That is why bundle size matters twice, and why the parse cost dominates on mobile.
JavaScript is byte-for-byte the most expensive resource type, costing far more per kilobyte than images because it must be parsed and executed as well as downloaded.
This calculator takes 5 inputs: Uncompressed bundle size, Compression saving, Parse rate, Mobile CPU slowdown, Connection speed. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.