Add embedded text-size measurement scripts#252
Open
AaronWebster wants to merge 1 commit into
Open
Conversation
scripts/embedded_bench.sh
Cross-compiles a tiny driver TU that pulls LargeConditionals::Ok()
and DisjunctionConditionals::Ok() into an object file, then reports
the object's `size` totals and the per-Ok() symbol sizes on:
* ARM Cortex-M4 Thumb-2 (arm-none-eabi-g++ -mthumb -mcpu=cortex-m4 -Os)
* MicroBlaze big-endian (microblaze-buildroot-linux-gnu-g++ -Os)
* Host x86-64 -Os as a reference
All builds use -ffunction-sections + -fdata-sections so each
function gets its own section, making `nm --size-sort` and the
object's total .text directly comparable across compiles.
scripts/embedded_compare.sh
Runs embedded_bench on the current branch and a base ref (default
master), forwarding the test schema and the benchmark TU through
the checkout so the comparison measures the generator output and
not the test surface area. Prints a side-by-side table of TU .text
and per-symbol sizes with absolute deltas and percentages. Builds
on scripts/regenerate_goldens.py from the previous PR.
Depends on having arm-none-eabi-g++ and a microblaze-* g++ on PATH
(/opt/microblaze for the Bootlin-built MicroBlaze toolchain).
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.
scripts/embedded_bench.shcross-compiles a tiny driver TU that pullsLargeConditionalsView::Ok()andDisjunctionConditionalsView::Ok()into an object file, then reportssizetotals and per-symbol sizes on:arm-none-eabi-g++ -mthumb -mcpu=cortex-m4 -Os)microblaze-buildroot-linux-gnu-g++ -Os)-Osas a referenceAll builds use
-ffunction-sections+-fdata-sectionsso each function gets its own section, makingnm --size-sortand the object's total.textdirectly comparable across compiles.scripts/embedded_compare.shruns the bench on the current branch and a base ref (defaultmaster), forwarding the test schema and benchmark TU through the checkout so the comparison measures the generator output and not the test surface area. Prints a side-by-side table with absolute deltas and percentages.Requires
arm-none-eabi-g++and amicroblaze-*g++on PATH or in/opt/microblaze. Builds on the regen script from #251.No generator changes; no measurable impact on generated code.