Skip to content
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

Add demo program to help compute binary sizes #415

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Conversation

mgeisler
Copy link
Owner

@mgeisler mgeisler commented Nov 7, 2021

The demo program can be compiled with and without Textwrap. This
allows us to compare the size of a quick-and-dirty implementation with
the implementation in Textwrap.

With Rust 1.54 (current stable), I see these results:

Configuration Binary Size Delta
quick-and-dirty implementation 252 KB — KB
textwrap without default features 268 KB 16 KB
textwrap with smawk 284 KB 32 KB
textwrap with unicode-width 276 KB 24 KB
textwrap with unicode-linebreak 362 KB 110 KB

The sizes are the stripped sizes and the binary is compiled in release
mode with this profile:

[profile.release]
lto = true
codegen-units = 1

The demo program can be compiled with and without Textwrap. This
allows us to compare the size of a quick-and-dirty implementation with
the implementation in Textwrap.

With Rust 1.54 (current stable), I see these results:

| Configuration                            |  Binary Size |    Delta |
| :---                                     |         ---: |     ---: |
| quick-and-dirty implementation           |       252 KB |     — KB |
| textwrap without default features        |       268 KB |    16 KB |
| textwrap with smawk                      |       284 KB |    32 KB |
| textwrap with unicode-width              |       276 KB |    24 KB |
| textwrap with unicode-linebreak          |       362 KB |   110 KB |

The sizes are the stripped sizes and the binary is compiled in release
mode with this profile:

```
[profile.release]
lto = true
codegen-units = 1
```
@mgeisler mgeisler merged commit 1ece89e into master Nov 7, 2021
@mgeisler mgeisler deleted the binary-sizes branch November 7, 2021 22:48
mgeisler added a commit that referenced this pull request Feb 27, 2022
Compared to 1.54 in #415, the binaries have grown by about 30 KB
across the board (also for the quick-and-dirty implementation).
@github-actions github-actions bot mentioned this pull request Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant