Skip to content

Always use the general case char count with optimize_for_size#125609

Merged
bors merged 1 commit intorust-lang:masterfrom
diondokter:opt-size-char-count
May 28, 2024
Merged

Always use the general case char count with optimize_for_size#125609
bors merged 1 commit intorust-lang:masterfrom
diondokter:opt-size-char-count

Conversation

@diondokter
Copy link
Copy Markdown
Contributor

The faster algo is really expensive, over a kilobyte if the full algo is present in a binary.
With this PR the general case algo is picked always instead of only for small strings.

In a test of mine this change makes the total binary go from 3116 bytes to 2032 bytes in opt-level 3 and from 1652 bytes to 1428 bytes in opt-level z. I've seen it much worse in real application, so the savings (especially on 'z') will be higher in many cases.

This is the second pr of this kind after #125606

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants