You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The JavaScript engine v8 was updated to 11.3 with Node 20, it was upgraded again to 11.8 with Node 20. Node 19 had v8 10.7.
Regarding the possibility that it could be nodejs/node#51360... maglev was introduced in Node 22, but you see a performance difference between Node 20 and Node 21. So my numbers do not point at a regression caused by maglev.
Unless there is something specific about buffers, this has nothing to do with Node.js, but it's rather a V8 change.
Buffers are just Uint8Arrays now, so if this reproduces with Uint8Array, this is more likely an V8 issue (especially if it reproduces with different versions of d8)
Can you reproduce it with just Uint8Array? If it's also reproducible in different versions of d8 then it's probably a V8 bug. I'd say among different V8 versions some performance differences are to be expected, since they are always tweaking the architecture and also they optimize towards better macro-benchmark scores, not necessarily maintaining any numbers you could see in micro benchmarks like this because the former is more meaningful to real world applications.
We're also experiencing a similar performance degradation - we're still investigating, but by running the same app with Node v22 (from v20), this is what happened to our GKE cluster:
We are running using PM2, and this is section of the processes themselves.
And this is of course causing pods to spawn like crazy.
Has anyone run their benchmarks against Node 23 yet? Maglev is relatively new, so I would expect that newer v8 versions would see differences in performance.
My main concern with this issue not getting eyeballs is that once people start avoiding upgrading it can become a habit. You will see people go from Node 20 to 24 but you'll have some people who just say "f it" and stay on Node 20 all the way until 24 LTS begins.
You guys don't want to turn into Java, where people fall behind and never catch up.
Please, also note that we are always measuring Node.js versions; we have different people working on this voluntarily. If you note some performance regression, please, consider opening an issue in https://github.com/nodejs/performance with a detailed example so we can investigate when we get some time.
Activity
climba03003 commentedon Apr 26, 2024
Maybe related to nodejs/node#51360
avivkeller commentedon Apr 27, 2024
@nodejs/performance
lemire commentedon Apr 27, 2024
@FishOrBear What are you running this on? Your numbers appear to be very, very high.
I do not see a regression. What I see on this test is that Node 20 had much better performance on this particular test, but it went away soon after.
Here are my results on a macbook...
Bun
Node 22
Node 21...
Node 20
Node 19
Node 18
Node 17
Node 16
Node 10
I think we need more tests to verify the issue.
cc @RafaelGSS @anonrig
mcollina commentedon Apr 27, 2024
Unless there is something specific about buffers, this has nothing to do with Node.js, but it's rather a V8 change.
FishOrBear commentedon Apr 28, 2024
I'm running it on an older cpu and your macbook performs well.
cpu:Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
lemire commentedon Apr 28, 2024
The JavaScript engine v8 was updated to 11.3 with Node 20, it was upgraded again to 11.8 with Node 20. Node 19 had v8 10.7.
Regarding the possibility that it could be nodejs/node#51360... maglev was introduced in Node 22, but you see a performance difference between Node 20 and Node 21. So my numbers do not point at a regression caused by maglev.
joyeecheung commentedon Apr 29, 2024
Buffers are just Uint8Arrays now, so if this reproduces with Uint8Array, this is more likely an V8 issue (especially if it reproduces with different versions of d8)
FishOrBear commentedon Jun 12, 2024
stay tuned
FishOrBear commentedon Sep 27, 2024
I have updated the nodejs version to 22.9.0 and I will update the benchmark.
nodejs20.17.0
nodejs.22.9.0
It is probably because nodejs has disabled Maglev in 22.9.0.
The performance is now similar to v20, but it is still slightly slower
@joyeecheung
joyeecheung commentedon Sep 27, 2024
Can you reproduce it with just Uint8Array? If it's also reproducible in different versions of d8 then it's probably a V8 bug. I'd say among different V8 versions some performance differences are to be expected, since they are always tweaking the architecture and also they optimize towards better macro-benchmark scores, not necessarily maintaining any numbers you could see in micro benchmarks like this because the former is more meaningful to real world applications.
jdmarshall commentedon Jan 25, 2025
What’s the prognosis on getting it reenabled? Have the V8 problems been identified?
mcollina commentedon Jan 25, 2025
@jdmarshall I don't think anybody is investigating right now.
birgersp commentedon Mar 27, 2025
FWIW (hope this can help in any way)
Decided to use current LTS in our project, upgrade 20 -> 22
Performance in VSCode intellisense became horrible
Been trying to investigate what could be the cause. Tried various versions on of VSCode.
Downgraded back 22 -> 20
Performance in VSCode is great again
kopiro commentedon Apr 1, 2025
We're also experiencing a similar performance degradation - we're still investigating, but by running the same app with Node v22 (from v20), this is what happened to our GKE cluster:
We are running using PM2, and this is section of the processes themselves.
And this is of course causing pods to spawn like crazy.
jdmarshall commentedon Apr 1, 2025
Has anyone run their benchmarks against Node 23 yet? Maglev is relatively new, so I would expect that newer v8 versions would see differences in performance.
My main concern with this issue not getting eyeballs is that once people start avoiding upgrading it can become a habit. You will see people go from Node 20 to 24 but you'll have some people who just say "f it" and stay on Node 20 all the way until 24 LTS begins.
You guys don't want to turn into Java, where people fall behind and never catch up.
RafaelGSS commentedon Apr 1, 2025
@jdmarshall see https://blog.rafaelgss.dev/state-of-nodejs-performance-2024. FWIW, we have disabled maglev by default on v23.
Please, also note that we are always measuring Node.js versions; we have different people working on this voluntarily. If you note some performance regression, please, consider opening an issue in https://github.com/nodejs/performance with a detailed example so we can investigate when we get some time.
FishOrBear commentedon May 8, 2025
Latest Tests
After improvements, bun is now faster than nodejs.
oven-sh/bun#10261