Uh oh!
There was an error while loading. Please reload this page.
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.
rustbot
commented
Jan 29, 2025
GuillaumeGomez
commented
Jan 29, 2025
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jan 29, 2025
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)
bors
commented
Jan 29, 2025
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Jan 29, 2025
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%) |
GuillaumeGomez
commented
Jan 29, 2025
Seems like we're all good. :) |
lolbinarycat
commented
Jan 29, 2025
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. |
notriddle
commented
Jan 30, 2025
I doubt that would be significant compared to all the other nightly-only code that gets included in stable rust. |
GuillaumeGomez
commented
Jan 30, 2025
Depends actually, the JS is quite sizeable after all. |
notriddle
commented
Jan 30, 2025
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/rustdoc141483120 build/x86_64-unknown-linux-gnu/stage2/lib/librustc_driver-d2315ca75e7f51a5.so157034464 total |
GuillaumeGomez
commented
Jan 30, 2025
|
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 |
GuillaumeGomez
commented
Jan 30, 2025
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. |
GuillaumeGomez
commented
Jan 30, 2025
If PR is ready for you, r=me and thanks! |
notriddle
commented
Jan 30, 2025
The unminified JS and CSS aren't included in the emitted documentation unless you supply the @bors r=GuillaumeGomez |
bors
commented
Jan 30, 2025
fmease
commented
Feb 5, 2025
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)
bors
commented
Feb 5, 2025
rust-log-analyzer
commented
Feb 5, 2025
The job Click to see the possible cause of the failure (guessed by this bot) |
bors
commented
Feb 5, 2025
💔 Test failed - checks-actions |
fmease
commented
Feb 5, 2025
spurious @bors retry |
Huh, apparently the segfault I observed in rollup #136572 wasn't just one-off, it also happened here... |
bors
commented
Feb 5, 2025
bors
commented
Feb 5, 2025
☀️ Test successful - checks-actions |
rust-timer
commented
Feb 6, 2025
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)