Repository navigation
Conversation
GCC does not align the targets of the computed gotos in the Baseline dispatch loop: -falign-jumps does not apply to them and -falign-labels is off by default. Only 9 of the 155 instruction implementations start at a 16-byte boundary. Each starts where the code before it ends, so any code size change moves the others and changes how the dispatch jumps are predicted. Build baseline_execution.cpp with -falign-labels=32 with GCC. This aligns every label in the file, so its code grows: the computed-goto loop from 29 KB to 49 KB and libevmone from 181 KB to 237 KB (GCC 16, x86-64-v3). clang aligns most of the instruction implementations to 16 bytes as loop headers. Aligning them to 32 bytes helped clang at x86-64-v2 and made the jump-heavy benchmarks slower at x86-64-v3, so clang keeps its default.
BenchmarksLayout samples: the SMOD handler padded by 0, 4, 8 and 12 bytes, which moves the instructions after it. 17 programs: the evm-benchmarks main and micro programs and 3 MUL contracts (chained through the second stack item, through the top item, independent). Each variant timed in one process, minimum of 9 rounds. Change vs master is the mean over the 4 paddings, [the spread over the paddings: master → this PR]. GCC 14 on GitHub runners, 18 jobs, x86-64-v2 and v3:
|
Merging this PR will degrade performance by 0.89%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance ChangesTip Investigate this regression by commenting Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1815 +/- ##
=======================================
Coverage 98.23% 98.23%
=======================================
Files 186 186
Lines 17192 17192
Branches 3963 3963
=======================================
Hits 16888 16888
Misses 235 235
Partials 69 69
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
GCC does not align the targets of the computed gotos in the Baseline dispatch loop:
-falign-jumpsdoes not apply to them and-falign-labelsis off by default. Only 9 of the 155 instruction implementations start at a 16-byte boundary. Each starts where the code before it ends, so any code size change moves the others and changes how the dispatch jumps are predicted.Build
baseline_execution.cppwith-falign-labels=32with GCC. This aligns every label in the file, so its code grows: the computed-goto loop from 29 KB to 49 KB and libevmone from 181 KB to 237 KB (GCC 16, x86-64-v3).clang aligns most of the instruction implementations to 16 bytes as loop headers. Aligning them to 32 bytes helped clang at x86-64-v2 and made the jump-heavy benchmarks slower at x86-64-v3, so clang keeps its default.