You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perry retires 85% more instructions but spends only 5% more cycles, at nearly double Node's
IPC. That combination says the extra instructions are cheap, well-predicted, and largely free —
so cutting the instruction count is not where the 18% comes from. The wall gap is somewhere a
sampling profiler cannot see it.
asyncpipe had exactly this shape and it has now been fixed — it sat at 1.07x wall against
1.71x instructions, and #8570 flipped it to 0.84x by suppressing redundant same-thread
promise-drain wakeups and removing per-element closure/guard/chained-promise allocations from
the intrinsic Promise.all path. Its instruction ratio fell 1.71x → 1.31x as a side effect.
That fix is the strongest available hint for this row, and #8243 has prior analysis.
What NOT to do
Do not reach for a sampler and start cutting instructions. asyncpipe taught this: aggregating sample over 14 runs of an ~88 ms program yielded one usable self-time sample, because the
process is almost always parked rather than running. A profiler will show you a flat, uninformative
profile and you will conclude there is nothing to fix.
Method
Instrument the event loop and the scheduling machinery rather than the code:
count and time event-loop wakeups, and how many are redundant with a drain already in flight
count microtask-queue drains, and jobs consumed per drain
count timer registrations and their latency from due-time to run
PROFILE_NOTIFY_DRAIN_SUPPRESSED_COUNT exists from #8570 and is a working example of making
this class of subject countable rather than merely observable.
Acceptance
Wall time is the primary signal here, unusually — the instruction count is already
known not to be the constraint. Report both, but do not claim a win on instructions alone.
Because the bench host is contended and this row is ~100 ms, use many interleaved repeats and
report spread; treat a wall delta as real only when the ranges are disjoint.
All 20 corpus programs byte-exact; whole-corpus timing before and after, every row moving
more than 1% reported.
Opt target 3 —
pipeline: 1.18x Node, but 1.85x instructions at 1.05x cyclesThis one is a different animal from the other two, and the difference is the whole ticket.
Measurement — quiet M1 mini, 5 shuffled interleaved repeats, verdict CLEAN, perry
fefdc367bPerry retires 85% more instructions but spends only 5% more cycles, at nearly double Node's
IPC. That combination says the extra instructions are cheap, well-predicted, and largely free —
so cutting the instruction count is not where the 18% comes from. The wall gap is somewhere a
sampling profiler cannot see it.
asyncpipehad exactly this shape and it has now been fixed — it sat at 1.07x wall against1.71x instructions, and #8570 flipped it to 0.84x by suppressing redundant same-thread
promise-drain wakeups and removing per-element closure/guard/chained-promise allocations from
the intrinsic
Promise.allpath. Its instruction ratio fell 1.71x → 1.31x as a side effect.That fix is the strongest available hint for this row, and #8243 has prior analysis.
What NOT to do
Do not reach for a sampler and start cutting instructions.
asyncpipetaught this: aggregatingsampleover 14 runs of an ~88 ms program yielded one usable self-time sample, because theprocess is almost always parked rather than running. A profiler will show you a flat, uninformative
profile and you will conclude there is nothing to fix.
Method
Instrument the event loop and the scheduling machinery rather than the code:
Promise.allPROFILE_NOTIFY_DRAIN_SUPPRESSED_COUNTexists from #8570 and is a working example of makingthis class of subject countable rather than merely observable.
Acceptance
known not to be the constraint. Report both, but do not claim a win on instructions alone.
report spread; treat a wall delta as real only when the ranges are disjoint.
more than 1% reported.