Object.setPrototypeOf performance regression after Node.js 12.18.0. #37457
Labels
performance
Issues and PRs related to the performance of Node.js.
v8 engine
Issues and PRs related to the V8 dependency.
Darwin Nikolays-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
), likely other platformsWhat steps will reproduce the bug?
The issue is hard to reproduce with a code snippet without external modules (I've been unable too), but occurs 100% of the time, if Express.js is used. Here is the snippet:
Under 12.18.0, the wrk test
wrk -t8 -c64 -d10s http://localhost:3005/hi/
shows around 28K req/s. However, under 12.18.1 and later it only shows 13K req/s.Normally, I'd assume this is a problem with Express.js, however:
res.end('')
instead ofres.send('')
doesn't eliminate the performance regressionres.end('')
IFObject.setPrototypeOf(obj, prototype)
is eliminated from Express's init middleware.I have always been able to replicate the issue with Express's
req
andres
addition Objects, but I haven't been able to do so with my own self-made Objects. Perhaps an object needs to be large enough to trigger problems withObject.setPrototypeOf(obj, prototype)
. @uwinkelvos in related problem #34322 requiredHow often does it reproduce? Is there a required condition?
What is the expected behavior?
No performance regression.
What do you see instead?
Additional information
I haven't been able to dig into this issue deeper, but judging by Node.JS 12.18.1 Changelog, I strongly suspect [
af95bd70bd
] to be the culpritThe text was updated successfully, but these errors were encountered: