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

Enable thin LTO release but not release-github #283

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

luigi311
Copy link
Contributor

Enable lto thin mode to reduce sizes
release
none -> thin
size: 217.7 mb -> 186.5 mb
time: 50s -> 51s

thin -> fat
size 186.5 mb -> 150.5 mb
time 51s -> 2m

Looks like release-github doesnt require it though as thin lto actually increases the binary size with debug disabled

release-github
none -> thin
size: 15.3 mb -> 16.4 mb
time: 37s -> 38s

thin -> fat
size: 16.4 mb -> 12.8
time: 38s -> 1m 15s

tauri build release mode also has a pretty big drop
305.3 mb -> 237.8 mb

tauri build with debug false
18.5 mb -> 20.1 mb

Signed-off-by: Luis Garcia <git@luigi311.com>
Signed-off-by: Luis Garcia <git@luigi311.com>
@luigi311
Copy link
Contributor Author

While lto didn't reduce the size of release-github I wonder what the performance looks like if any difference at all.

@ikatson
Copy link
Owner

ikatson commented Nov 25, 2024

Thank you so much for the sponsorship, it really made my day! I'm currently traveling until Friday and may have limited availability to review your PRs closely, but I'll do my best to take a look before then.

@luigi311
Copy link
Contributor Author

No worries theres no pressure feel free to take your time, none of my changes are anything major just figured i would take a look at some simpler stuff and see if its worth it or not.

@ikatson
Copy link
Owner

ikatson commented Nov 27, 2024

How about build times? I'd argue this might be even more important than binary size.

Wdyt of setting them in reverse like this:

  • "release" to no lto (assuming that's the fastest build time). So that locally you can "cargo build --release" and it's not taking forever.
  • "release-github" to lto, cause we don't care about release build times as much in CI. Probably thin, as a balance between build time, build size and final performance.

@luigi311
Copy link
Contributor Author

Build times are what measured for time in the original description sorry should of made that clear. Its the reason i left the default to thin instead of fat since that inflates the build times like crazy.

I still need to take a look to see what performance looks like between the two to make sure this doesnt cause any regressions. Is there a method you like to use for performance testing? I see your cargo test are pretty extensive, should I use that as a reference?

@ikatson
Copy link
Owner

ikatson commented Nov 28, 2024

I still need to take a look to see what performance looks like between the two to make sure this doesnt cause any regressions. Is there a method you like to use for performance testing? I see your cargo test are pretty extensive, should I use that as a reference?

That's probably unnecessary, as there's no reference to compare against - there's no official "benchmark" for perf testing rqbit.

For larger / core changes I usually run "make devserver-profile", download something popular, then look at CPU and profiler output not to contain obvious hotspots.

@ikatson
Copy link
Owner

ikatson commented Nov 28, 2024

It's LGTM like this already, so I'll merge. I think I'm even ok making it default for release-github, I don't see any downsides. A tiny size increase doesn't matter, but it could boost perf in theory.

Thanks for running all those comparisons!

@ikatson ikatson merged commit a728b66 into ikatson:main Nov 28, 2024
6 checks passed
@luigi311 luigi311 deleted the lto branch November 28, 2024 09:23
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.

2 participants