Repository navigation
Conversation
The fuel check branches to a block that calls the `out_of_gas` builtin, which runs only when fuel is exhausted. The epoch check already marks its equivalent `new_epoch` block cold; do the same for the fuel check so the slow path is moved out of line and the fast path falls through.
cfallin
approved these changes
Dec 3, 2026
cfallin
left a comment
Member
There was a problem hiding this comment.
Fantastic discovery -- thanks so much!
This branch has not been deployed
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.
The fuel check branches to a block that calls the
out_of_gasbuiltin, which runs only when fuel is exhausted. The epoch check already marks its equivalentnew_epochblock cold; do the same for the fuel check so the slow path is moved out of line and the fast path falls through.Execution cycles with fuel (
-Wfuel=1000000000000000000),pca-20-minsuite, main7e00d84d7vs this branch, Sightglass effect size at 99% confidence.Geomean (29 benchmarks): this branch is 1.05–1.07× faster on Zen 5 (AMD EPYC 4545P) and 1.08–1.10× / 1.08–1.09× faster on an Apple M3 Pro (two runs with the engine order reversed).
Control: with
-Wepoch-interruption=yinstead of fuel both builds compile to identical code. Sightglass finds no geomean difference in compilation, instantiation or execution on either machine; on the M3 no single benchmark differs, on Zen 5 three differ by at most 2% (the per-benchmark noise floor there).Compile time: with fuel, compilation takes 1–3% more cycles on Zen 5 and 1.5–2% more on the M3 (both orders), while retired instructions in the compilation phase grow by only 0.13% (Zen 5).
Zen 5 per benchmark
Apple M3 Pro per benchmark