node22 performance degradation
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 399
- Forks
- 11
- Avg merge
- 29m
- Merged PRs (30d)
- 1
Description
Version
22.0.0
Platform
Linux debian 6.1.0-13-amd64 nodejs/node#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
const COUNT1 = 1024;
const COUNT2 = 5120;
const COUNT3 = 20480;
function encrypt(buf, value = 199)
{
let count = Math.min(buf.length, COUNT1);
for (let i = 0; i < count; i++)
buf[i] += value;
count = Math.min(buf.length, COUNT2);
for (let i = COUNT1; i < count; i += 2)
buf[i] += value;
}
const buf = Buffer.alloc(65535);
function aa()
{
console.time("j");
for (let i = 0; i < 20 * 125; i++)
encrypt(buf, 199);
console.timeEnd("j");
}
for (let index = 0; index < 20; index++) {
aa()
}
When I increase the number of operations, due to the optimization of v8, the performance will be shortened to 23ms, but it is still worse than the previous 21ms performance.
How often does it reproduce? Is there a required condition?
node perf.js
What is the expected behavior? Why is that the expected behavior?
in nodejs 20.12.2
j: 64.709ms
j: 54.228ms
j: 21.822ms
j: 21.83ms
j: 21.858ms
j: 21.851ms
j: 21.821ms
j: 21.841ms
j: 21.827ms
j: 21.887ms
j: 21.823ms
j: 21.863ms
j: 21.842ms
j: 21.857ms
j: 21.845ms
j: 21.851ms
j: 21.821ms
j: 21.843ms
j: 21.816ms
j: 21.847ms
in nodejs 22.0.0
j: 44.602ms
j: 34.992ms
j: 35.053ms
j: 34.981ms
j: 35.355ms
j: 35.013ms
j: 35.036ms
j: 34.979ms
j: 35.056ms
j: 35.135ms
j: 35.09ms
j: 34.989ms
j: 35.023ms
j: 34.974ms
j: 35.028ms
j: 35.076ms
j: 35.034ms
j: 34.973ms
j: 35.045ms
j: 35.013ms
What do you see instead?
1
Additional information
1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided node perf.js reproduction under Node.js 20.12.2 and 22.0.0 on the stated Linux environment, then compare the benchmark timings with the reported results. Done means the Node.js 22 performance regression is characterized and no longer produces the reported slowdown, with supporting benchmark results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100