-
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
lib: make FreeList faster #27021
lib: make FreeList faster #27021
Conversation
1ab7867
to
18428c9
Compare
Benchmark results
|
Suggestion for the commit title: "lib: make FreeList faster" |
Because these tests are often forgotten until the nightly run: Please make sure |
The test will continue to pass. |
I'm getting the following lint error locally for this: $ make lint-js
Running JS linter...
/Users/danielbevenius/work/nodejs/node/lib/internal/freelist.js
18:7 error Unexpected use of 'Reflect' no-restricted-globals
✖ 1 problem (1 error, 0 warnings) Not sure why this is not picked up by CI. I'm happy to add an ignore to this line but wanted to bring it up here first. |
@danbev the reason is that the rule just landed recently and the CI ran before the rule landed. Instead of adding an exception it would be ideal to use the primordials ( |
I opened #27083 to make the error message clearer. |
Make FreeList faster by using Reflect.apply and not using is_reused_symbol, but rather just checking whether any items are present in the list prior to calling alloc.
3491ab3
to
4409bf2
Compare
Make FreeList faster by using Reflect.apply and not using is_reused_symbol, but rather just checking whether any items are present in the list prior to calling alloc. PR-URL: #27021 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #27021 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1st commit makes FreeList alloc faster by using
Reflect.apply
and removingis_reused_symbol
.2nd commit fixes a benchmark that I needed to run to confirm the results.
CI: https://ci.nodejs.org/job/node-test-pull-request/22260/
Benchmarks: https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/312/
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes