-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
rustdoc: run css and html minifier at build instead of runtime #136253
Conversation
This way, adding a bunch of comments to the JS files won't make rustdoc slower.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
rustdoc: run css and html minifier at build instead of runtime This way, adding a bunch of comments to the JS files won't make rustdoc slower. Meant to address rust-lang#136161 (comment)
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (c2ca307): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.5%, secondary -2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -2.7%, secondary -3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 777.437s -> 777.798s (0.05%) |
Seems like we're all good. :) |
perhaps for non-nightly builds the unminified source could be excluded entirely? although i'm not sure if that would violate some policy, since it would introduce the possibility of bugs that only show up on more stable releases. |
I doubt that would be significant compared to all the other nightly-only code that gets included in stable rust. |
Depends actually, the JS is quite sizeable after all. |
search.js is $ wc -c src/librustdoc/html/static/js/*.js build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc build/x86_64-unknown-linux-gnu/stage2/lib/librustc_driver-d2315ca75e7f51a5.so
86194 src/librustdoc/html/static/js/main.js
5350 src/librustdoc/html/static/js/scrape-examples.js
230744 src/librustdoc/html/static/js/search.js
11117 src/librustdoc/html/static/js/settings.js
6160 src/librustdoc/html/static/js/src-script.js
13611 src/librustdoc/html/static/js/storage.js
15198168 build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc
141483120 build/x86_64-unknown-linux-gnu/stage2/lib/librustc_driver-d2315ca75e7f51a5.so
157034464 total |
|
I have no idea what you mean.
The problem isn't work. It's risk. First, because this isn't actually unreachable code in a stable build. You can use "nightly-only features" like this one with the Second, while I'm not aware of a policy against trying to strip "unreachable" code from the stable compiler, it seems pretty rare. I've tried a few major unstable features with RUSTC_BOOTSTRAP=1, and was able to use |
I meant in term of doc size since it's what you displayed.
With your explanation, I agree. I forgot we could run unstable features with stable channel. Then we should provide both JS all the time. |
If PR is ready for you, r=me and thanks! |
The unminified JS and CSS aren't included in the emitted documentation unless you supply the @bors r=GuillaumeGomez |
To place it above the next rollup @bors p=6 |
…illaumeGomez rustdoc: run css and html minifier at build instead of runtime This way, adding a bunch of comments to the JS files won't make rustdoc slower. Meant to address rust-lang#136161 (comment)
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
spurious @bors retry |
Huh, apparently the segfault I observed in rollup #136572 wasn't just one-off, it also happened here... |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a9730c3): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 2.4%, secondary -2.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -2.5%, secondary -3.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 778.801s -> 776.778s (-0.26%) |
This way, adding a bunch of comments to the JS files won't make rustdoc slower.
Meant to address #136161 (comment)