Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v8.10.0 proposal #18336
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
Uh oh!
There was an error while loading. Please reload this page.
v8.10.0 proposal #18336
Changes from 1 commit
aa63e02f276cd9b5bc3f8025b9f2bd47272e674488ae4428e6d55a4ccce92cc03873db5a199a9089f18e0f7c898086af681d3d1dd5dab90b91d4eb502111753705e0e2c709656c9bdc1c2028fa068d52d337d93aaada57b0e2044324e7753ca71b00fcc5b99dc480f830c60768f9ea2398cc1fe6df169cd1c854f59def2a70daf958da4143c81b851b8b0ed3d4f355a535e76b7601bb021ec9172f359206ed57739d4add202af31a0ceed2c87d504d98c83c6d1b224d762c1ec5b672af78c8c61ff03d2f35a51d4e4959812f3d91d0e37054d3d0aaf80468ccceb779081cc0e7673fdc695cbf0890fe169a5ada4151f2dfc96abea0964850ad2138b28c5fe7b822e93eb121d514b6c18259aa5059cf8df31e3ea50e233f51d7f74ddf88afb4f154e7680761275485ad1990d22e05101e61279893aff27a17eb0215b69c7103ae37b21c2783bde85204bb5cafe38f56cbf273c29a7f9e12f393eb16e841a390c5bd468235daea0766a4b8c579fe36cd95e83150d5c8a34532e85a135bc61e734e0a452d2c5d4727048e38ad98b3c2332e4fa265eadfc89fcf4d0bc982f61474a476597b2fedcf9ac50780c18250a5ab3ff0ede49dd536aa0adc0fd0518aaca4474746bbf3a648b751999d096f85e456401a4e28e80dec349b40f909a8335bbfff00d758f518238c2106e4e210798e0cbc390ef35a12419b865e9e4e52efb16beb377f3de37b994b90576f9a597aa6a41d820cc0cff1d458bf88345892ec6f67873826b0526ba072902abede7a3d3aa9ee92a93c0805084baa4f58aa7fc127ebee8edb71a33c0b690a916a980b5d80b0eae8c838711f3440e30ca9be734c50ee64550a064c451ad36aaae68d32b84fa9758b7301e31682fed8d302a2c881f99aba18a000e844ab4f0cae48961331a2a3588730c5093fcdea44b9d47cb9a8cc0ea7474d776542276792defcc180a38ef07bb1622ddc4366a19cf3f801b3074add3fea710e91135b908a2d7f835573af7e6fe298579de5607f5880973ecafc528915e07b8fd845d8087cdaf58fbcab5d66c209f52d939c75a0ff7b48a3299482cb343cb6b52afa25f1803b896aa778391523a4e8a92deb70419e799514c89666bda835574d86ccd554b8a0e6cb3f78eb8141cfc67c67b7ad3d629be2454a3d9af88c0f850e5ba15c847e477e7d137531a45f381e8504054c577933af779a8b8143a950776a432fce636ce751b1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
This removes the `process._needImmediateCallback` property and its semantics of having a 1/0 switch that tells C++ whether immediates are currently scheduled. Instead, a counter keeping track of all immediates is created, that can be increased on `setImmediate()` or decreased when an immediate is run or cleared. This is faster, because rather than reading/writing a C++ getter, this operation can be performed as a direct memory read/write via a typed array. The only C++ call that is left to make is activating the native handles upon creation of the first `Immediate` after the queue is empty. One other (good!) side-effect is that `immediate._destroyed` now reliably tells whether an `immediate` is still scheduled to run or not. Also, as a nice extra, this should make it easier to implement an internal variant of `setImmediate` for C++ that piggybacks off the same mechanism, which should be useful at least for async hooks and HTTP/2. Benchmark results: $ ./node benchmark/compare.js --new ./node --old ./node-master-1b093cb93df0 --runs 10 --filter immediate timers | Rscript benchmark/compare.R [00:08:53|% 100| 4/4 files | 20/20 runs | 1/1 configs]: Done improvement confidence p.value timers/immediate.js type="breadth" thousands=2000 25.61 % ** 1.432301e-03 timers/immediate.js type="breadth1" thousands=2000 7.66 % 1.320233e-01 timers/immediate.js type="breadth4" thousands=2000 4.61 % 5.669053e-01 timers/immediate.js type="clear" thousands=2000 311.40 % *** 3.896291e-07 timers/immediate.js type="depth" thousands=2000 17.54 % ** 9.755389e-03 timers/immediate.js type="depth1" thousands=2000 17.09 % *** 7.176229e-04 timers/set-immediate-breadth-args.js millions=5 10.63 % * 4.250034e-02 timers/set-immediate-breadth.js millions=10 20.62 % *** 9.150439e-07 timers/set-immediate-depth-args.js millions=10 17.97 % *** 6.819135e-10 Backport-PR-URL: #18179 PR-URL: #17064 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing