-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[build] simplify makeqstrdata heuristic #4564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which board or translation you verified, but on trinket_m0 with de_DE this saved more like 28 bytes. However, anything is welcome.
Given the +/- spread, maybe delay merging this? Could this be calculated per language both ways, and the best chosen? Or does it have to be uniform across languages? If this change makes a difference, maybe a different calculation would be even better for some languages. |
It would be nice to figure out a "right" heuristic. I have some doodles but they've never become mergeable. The general idea is:
The true bit savings is The tree where I worked on this is jepler/translation-compression-improvements and specifically jepler@260d5ca |
To clarify, my original motivation was, why use a sophisticated formula with log and a few magic constants, when a near-trivial estimate performs no worse? @jepler's work, aiming at improving the compression by increasing its sophistication, is in a totally different direction. |
The simpler one saves, on average, 51 more bytes per translation; the biggest translation per board is reduced, on average, by 85 bytes.
With a slightly different heuristic (but still simpler than the one currently used), the spread looks more convincing: As for the per-language stats, note that the limiting factor for a board is the biggest translation: it doesn't matter if other translations get smaller, you still cannot add new code if it doesn't fit with the biggest translation. The new graph includes a bar for the average savings for the biggest translation per board: |
Can you share the scripts to generate the graphs? |
No functional change.
The complexity of the formula is not really important, because it contributes negligibly to build time, I would think. The important thing is to reduce the size of the largest language build. |
This generates CSV that I open with Excel for graphing. (The 10 singled-out boards, as well as xtensa ones, don't print out raw code size in their build logs.) |
Certainly so; but it does contribute to the time it takes to read the code and understand how it works :) |
@tyomitch - Hi, I was worried about some builds growing while others shrank, based on the graphs above, which might simply cause overflows for other different languages. I wondered if there was a formula that showed nearly reductions more uniformly. |
Sure; my point above was that if the biggest translation per board shrinks, it doesn't matter if other translations for the board grow. dynalora_usb grew by 156 bytes, nine other boards grew up to 52 bytes, and all other boards shrank. The graph below shows the percentage of currently free space gained or lost: |
Split out of adafruit#4564 No functional change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine merging this as-is. I trust it reduces the size of the largest languages.
@tyomitch - sorry, I missed your reply to my last comment; I did not mean to let it languish. |
The simpler one saves ~150 more bytes per translation.