When using the object spread operator to "join" two objects, the performance has decreased by ~ factor 20. This only happens with objects that have at least 50 keys and the keys of the first one need to be non trivial.
see:
https://github.com/uwinkelvos/node_object-spread_preformance-regression
If i had to guess it's related to:
https://github.com/nodejs/node/commit/af95bd70bd8ddb723107f6b2777423711f2e98ad#diff-ff06109b32824fc20fec697f584a42e3
Always reproducible on aforementioned platforms.
performance level like 12.18.0
factor 20 performance loss.
You might want to report this at https://bugs.chromium.org/p/v8/issues/list as well.
agreed
Hey! I was out for two weeks, but you are right of course. Created a v8 issue: https://bugs.chromium.org/p/v8/issues/detail?id=10763
Confirmed it's caused by 78eb420fed154b7729283a3d63c99fa9989ffbea.
https://github.com/nodejs/node/commit/78eb420fed154b7729283a3d63c99fa9989ffbea was introduced to fix https://github.com/nodejs/node/issues/32049... however it caused regressions of its own. What should we do?
cc @nodejs/tsc @nodejs/v8
The overhead here seems worse than #32049, correct? I wonder which regression our users are more likely to hit (although we have no way of knowing it for sure). The best thing would be to cherry-pick a fix as soon as one is available upstream, but until then we might want to consider reverting https://github.com/nodejs/node/commit/78eb420fed154b7729283a3d63c99fa9989ffbea.
Btw. there has been some progress on the upstream bug which is alread on _main_ branch. I have not tested the changes though.
I'm working on this on the side, currently these are just cleanup CLs to pave the way for a proper fix.
Ah, alright! Thanks for the work and the update!
Acmeair benchmark have ~40% degradation on my end because of https://github.com/nodejs/node/commit/78eb420fed154b7729283a3d63c99fa9989ffbea, you can also see the effect here, and it affect v14.5 onward as well.
Most helpful comment
I'm working on this on the side, currently these are just cleanup CLs to pave the way for a proper fix.