Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(cli): enable node 22 compile cache #312

Merged
merged 3 commits into from
Sep 30, 2024
Merged

perf(cli): enable node 22 compile cache #312

merged 3 commits into from
Sep 30, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 30, 2024

Leverage new module.enableCompileCache for Node.js 22+ (more info nodejs/node#54501)

Speedup is about %17 in Node.js v22.9.0 (Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz perf mode)

hyperfine --warmup 3 'node ./lib/jiti-cli.mjs test/fixtures/typescript' 'NODE_DISABLE_COMPILE_CACHE=1 node ./lib/jiti-cli.mjs test/fixtures/typescript'
Benchmark 1: node ./lib/jiti-cli.mjs test/fixtures/typescript
  Time (mean ± σ):     130.3 ms ±   0.8 ms    [User: 131.3 ms, System: 18.0 ms]
  Range (min … max):   128.8 ms … 131.3 ms    22 runs
 
Benchmark 2: NODE_DISABLE_COMPILE_CACHE=1 node ./lib/jiti-cli.mjs test/fixtures/typescript
  Time (mean ± σ):     152.0 ms ±   1.1 ms    [User: 149.2 ms, System: 22.0 ms]
  Range (min … max):   150.1 ms … 154.0 ms    19 runs
 
Summary
  'node ./lib/jiti-cli.mjs test/fixtures/typescript' ran
    1.17 ± 0.01 times faster than 'NODE_DISABLE_COMPILE_CACHE=1 node ./lib/jiti-cli.mjs test/fixtures/typescript'

@pi0 pi0 self-assigned this Sep 30, 2024
@pi0 pi0 merged commit 36e0957 into main Sep 30, 2024
7 checks passed
@pi0 pi0 deleted the perf/cli-v8-cache branch September 30, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant