[BENCH, do not merge] Measure -fomit-frame-pointer and --icf=all on the macOS bindings - #6731
Draft
Fedr wants to merge 4 commits into
Draft
[BENCH, do not merge] Measure -fomit-frame-pointer and --icf=all on the macOS bindings#6731Fedr wants to merge 4 commits into
Fedr wants to merge 4 commits into
Conversation
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.
Benchmark only, not for merge. Measures the two size levers that are left for the bindings after
-Ozand ThinLTO, on the macOS legs.Why these two, and not the usual suspects: I scanned the published
mrmeshpy.soof 3.1.3.429 and-Ozalready leaves 477 bytes of alignment padding in a 34.7 MB__text, so-falign-functionsand friends have nothing to recover. What the scan did find is 202,218push rbp; mov rbp,rspprologues in the macOS x86_64 build against 3 in the Linux one — Apple's Clang keeps frame pointers on x86-64, Linux Clang omits them at-O2+ — worth roughly 1.2 MB with the epilogues, plus whatever freeingrbpsaves in spills.--icf=allis restricted to Linux with the note "until lld-link (Windows) and ld64.lld (macOS) get their own measurements", where it removed 11% of the module. This is that measurement for macOS.The step prints file size and
__textfor four variants:--icf=all-fomit-frame-pointerOnly one recompile round is needed, so this adds roughly 15-25 min per macOS leg. Every non-macOS platform is disabled by label. I will close this PR and delete the branch once the numbers are in.
Note that neither flag touches the actual x86-64 vs arm64 gap (
__text34.7 MB vs 21.4 MB on macOS, 34.4 vs 21.9 on Linux) — that is instruction encoding and register count, and no flag fixes it.