Skip to content

build: disable v8 snapshot compression

Following https://chromium-review.googlesource.com/c/v8/v8/+/3275554. Locally the binary size is increased by ~2.4mb (+2.9%) with a pretty significant speedup in startup:

                                                                                     confidence improvement accuracy (*)   (**)  (***)
misc/startup.js count=30 mode='process' script='benchmark/fixtures/require-builtins'        ***     12.28 %       ±1.13% ±1.52% ±2.00%
misc/startup.js count=30 mode='process' script='test/fixtures/semicolon'                    ***     17.39 %       ±1.12% ±1.50% ±1.97%
misc/startup.js count=30 mode='worker' script='benchmark/fixtures/require-builtins'         ***     14.54 %       ±0.77% ±1.03% ±1.35%
misc/startup.js count=30 mode='worker' script='test/fixtures/semicolon'                     ***     18.02 %       ±1.02% ±1.36% ±1.79%

I think the increased binary size is worth it, but if we really worry about it, another (perhaps better) option would be to disable the built-in compression of V8 and compress the snapshot + source code + code cache ourselves using a different compression library (e.g. Deno switched to lz4 and zstd and got a pretty significant performance boost). I'd suggest to just disable it for now, regardless of whether we can follow up with a compression strategy that can reduce the binary size significantly without hurting performance, because currently a 2.9% binary size saving is not really worth the performance regression.

Merge request reports

Loading