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

use brotli to compress self profile response #1968

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

s7tya
Copy link
Contributor

@s7tya s7tya commented Aug 23, 2024

alternative to #1966
This PR is using brotli to compress and consider Accept-Encoding header according to previous PR's discussion.

@s7tya s7tya marked this pull request as ready for review August 23, 2024 10:15
@s7tya
Copy link
Contributor Author

s7tya commented Aug 23, 2024

It will take about 22s to load both directory giving gzip into the perfetto, and using brotli & content-encoding: brotli by my eyes & stopwatch.
However, it would be nice to use brotli than gzip if it's available, so I propose this than the previous one.

@s7tya
Copy link
Contributor Author

s7tya commented Aug 23, 2024

(Current production RLO takes about 200s to load. so this makes x10 faster. )

@Kobzol
Copy link
Contributor

Kobzol commented Aug 23, 2024

Because we don't have #1896 yet, it is not easy to fully test (and benchmark) this locally. So I guess we can try it on the live server and see how fast it is in practice.

site/src/server.rs Outdated Show resolved Hide resolved
site/src/self_profile.rs Outdated Show resolved Hide resolved
site/src/request_handlers/self_profile.rs Outdated Show resolved Hide resolved
@s7tya s7tya marked this pull request as draft August 23, 2024 11:37
@Kobzol
Copy link
Contributor

Kobzol commented Aug 23, 2024

Looks good! :) Was 5 the best trade-off for the compression options that you found? :)

@s7tya
Copy link
Contributor Author

s7tya commented Aug 23, 2024

I just took benchmark and changed to 4.

207.22 MB → 19.55 MB (size: 9.43%, quality: 2, time: 713.505083ms)
207.22 MB → 13.85 MB (size: 6.69%, quality: 3, time: 744.224166ms)
207.22 MB → 11.42 MB (size: 5.51%, quality: 4, time: 738.653667ms)
207.22 MB → 12.88 MB (size: 6.22%, quality: 5, time: 1.467692333s)

@s7tya s7tya marked this pull request as ready for review August 23, 2024 13:41
Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the benchmark! The comment in server.rs said that 4 might be too slow, maybe on the production server it will be a bit worse, but I'm fine with starting with 4, it looks like it has a good trade-off locally! It is surprising that 5 produces a larger output than 4 though.

Thanks for working on this ❤️

@Kobzol Kobzol merged commit 32a6ce2 into rust-lang:master Aug 24, 2024
11 checks passed
@s7tya s7tya deleted the brotli-profile branch September 22, 2024 08:12
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