deps: V8: cherry-pick 25650aa994 - #66500
Open
nigrosimone wants to merge 1 commit into
Open
nigrosimone wants to merge 1 commit into
nigrosimone wants to merge 1 commit into
Conversation
Original commit message:
[microtask] Early-exit empty PerformCheckpointInternal and OnCompleted
Microtask checkpoints (MicrotaskQueue::PerformCheckpoint) are executed
frequently at the end of every DOM event listener, microtask scope exit,
timer callback, and mutation observer turn.
In typical DOM interactions and event dispatch cycles, the microtask
queue is frequently empty (size_ == 0), no microtask completion
callbacks are registered, and no weak references were kept during the
job (weak_refs_keep_during_job == undefined_value()).
Previously, even when the queue was empty, PerformCheckpointInternal
unconditionally allocated an artificial
MicrotasksScope(kDoNotRunMicrotasks), called RunMicrotasks (which set
running state flags, created suppress scopes, and rewound entered
contexts), invoked OnCompleted, and called isolate->ClearKeptObjects()
(performing an unconditional store to the weak_refs_keep_during_job root
table slot).
This CL fast-paths PerformCheckpointInternal when size() == 0,
microtasks_completed_callbacks_ is empty, and weak_refs_keep_during_job
is undefined. If WeakRef.prototype.deref() was invoked during the turn,
weak_refs_keep_during_job holds an OrderedHashSet, so the early-exit is
skipped and ClearKeptObjects() runs to clear kept objects as required by
ECMAScript §26.1.
Pinpoint Try Job on Apple Silicon M1 (150 iterations, Job
158c2910690000):
- Speedometer 3 Score: 31.42 -> 31.48 (+0.21%, p=0.0293, stat-sig win)
- TodoMVC-JavaScript-ES6-Webpack: -0.87% (p=0.0001)
- NewsSite-Nuxt: -0.40% (p=0.0001)
- TodoMVC-Angular: -0.45% (p=0.0681)
- TodoMVC-jQuery: -0.36% (p=0.6023)
- Charts-chartjs: -0.21% (p=0.0005)
- React-Stockcharts-SVG: -0.26% (p=0.0144)
Bug: 553846289
TAG=agy
CONV=a3721850-14cb-425b-8d34-169f9934ed78
Change-Id: Ic996d283b746a5684a55c9fbc56d8fcfb38ac299
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8312487
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109567}
Refs: v8/v8@25650aa
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
Collaborator
|
Review requested:
|
nigrosimone
marked this pull request as ready for review
October 4, 2026 06:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-pick of v8/v8@25650aa994 (V8 15.4): an empty microtask checkpoint returns early, when there is no completed callback and no WeakRef kept during the job.
Node runs a checkpoint after every top-level callback and the queue is usually empty there, so
node::MakeCallbackgoes from 132.9 to 121.9 ns.benchmark/compare.js,napi/make_callbackwith thetypecases of #66326, 30 runs, Linux x64, one core, same V8 14.6.202.34 as main:type=Callruns no checkpoint per call, and the same binary against itself stays inside ±2.4% with no stars. The async_hooks, ALS, microtask, WeakRef, FinalizationRegistry, promise and timers tests give the same result as without it.Refs: nodejs/performance#24
Disclosure: I used Opus 5.5 (Max) as coding assistant