-
Notifications
You must be signed in to change notification settings - Fork 30k
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
util: prefer Reflect.ownKeys(…)
in util.inspect(…)
#36740
util: prefer Reflect.ownKeys(…)
in util.inspect(…)
#36740
Conversation
Reflect.ownKeys(…)
Reflect.ownKeys(…)
in util.inspect(…)
This seems to introduce a performance regression:
|
@ExE-Boss |
The commit responsible for that is v8/v8@f9868ea. Oddly enough, |
e1cce62
to
6c88555
Compare
Bnechmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/906/ EDIT: no significant regressions anymore 🎉 Benchmark results
|
PR-URL: nodejs#36740 Reviewed-By: Antoine du Hamel <[email protected]>
6c88555
to
e9944e9
Compare
Landed in e9944e9 |
The benchmarks never hit the changed code path. |
PR-URL: #36740 Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #36740 Reviewed-By: Antoine du Hamel <[email protected]>
Using
Reflect.ownKeys(obj)
instead of:is more efficient, as it only has to call
obj.[[OwnPropertyKeys]]()
once and return the resulting List as anArray
, instead of calling it twice and returning two separate arrays, which have thestring
andsymbol
keys filtered: https://tc39.es/ecma262/#sec-getownpropertykeys, which are then joined back using%Array.prototype.push%
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes