Skip to content

use brotli to compress self profile response#1968

Merged
Kobzol merged 1 commit into
rust-lang:masterfrom
s7tya:brotli-profile
Aug 24, 2024
Merged

use brotli to compress self profile response#1968
Kobzol merged 1 commit into
rust-lang:masterfrom
s7tya:brotli-profile

Conversation

@s7tya

@s7tya s7tya commented Aug 23, 2024

Copy link
Copy Markdown
Contributor

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

s7tya commented Aug 23, 2024

Copy link
Copy Markdown
Contributor Author

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

s7tya commented Aug 23, 2024

Copy link
Copy Markdown
Contributor Author

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

@Kobzol

Kobzol commented Aug 23, 2024

Copy link
Copy Markdown
Member

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.

Comment thread site/src/server.rs Outdated
Comment thread site/src/self_profile.rs Outdated
Comment thread site/src/request_handlers/self_profile.rs Outdated
@s7tya s7tya marked this pull request as draft August 23, 2024 11:37
@Kobzol

Kobzol commented Aug 23, 2024

Copy link
Copy Markdown
Member

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

@s7tya

s7tya commented Aug 23, 2024

Copy link
Copy Markdown
Contributor Author

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

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

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
@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