node icon indicating copy to clipboard operation
node copied to clipboard

build: use more aggressive LTO on gcc

Open anonrig opened this issue 2 months ago • 17 comments

Please validate locally before landing this pull-request. This is an area that I'm not familiar with.

Using more aggressive LTO, the startup time of Node.js can be reduced from 38ms to 28ms.

Before

➜  node git:(main) ✗ hyperfine 'out/Release/node index.js' --warmup 30
Benchmark 1: out/Release/node index.js
  Time (mean ± σ):      38.7 ms ±   0.8 ms    [User: 27.1 ms, System: 8.1 ms]
  Range (min … max):    37.9 ms …  42.2 ms    70 runs

After

➜  node git:(main) ✗ hyperfine 'out/Release/node index.js' --warmup 30
Benchmark 1: out/Release/node index.js
  Time (mean ± σ):      32.0 ms ±   2.7 ms    [User: 26.7 ms, System: 5.3 ms]
  Range (min … max):    28.5 ms …  42.3 ms    53 runs

anonrig avatar Dec 05 '24 00:12 anonrig