-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: use smarter encoding for playground URL #107284
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @jsha (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
Jan 25, 2023
jsha
requested changes
Jan 25, 2023
@bors r+ rollup |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 25, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 25, 2023
rustdoc: use smarter encoding for playground URL The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 5.0% and 0.044% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 753023 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((753023-781842)/781842)=-3.7 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3189989 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3189989-3204351)/3204351)=-0.044 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8067 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8067-8495)/8495)=-5.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69492 after.tar.gz 100*((69492-69600)/69600)=-0.16
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 25, 2023
rustdoc: use smarter encoding for playground URL The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 5.0% and 0.044% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 753023 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((753023-781842)/781842)=-3.7 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3189989 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3189989-3204351)/3204351)=-0.044 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8067 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8067-8495)/8495)=-5.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69492 after.tar.gz 100*((69492-69600)/69600)=-0.16
Failed in rollup. @bors r- |
bors
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Jan 25, 2023
notriddle
force-pushed
the
notriddle/plus
branch
from
January 26, 2023 17:43
0db0419
to
9a91ffa
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jan 26, 2023
The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 759235 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((759235-781842)/781842)=-2.8 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3194173 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3194173-3204351)/3204351)=-0.031 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8151 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8151-8495)/8495)=-4.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69480 after.tar.gz 100*((69480-69600)/69600)=-0.17
notriddle
force-pushed
the
notriddle/plus
branch
from
January 26, 2023 17:51
9a91ffa
to
51df99f
Compare
It looks like html5-tidy rejects any url that has things outside the url code points set. I've run it locally, and validated that the fix worked. @bors r=jsha |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jan 27, 2023
rustdoc: use smarter encoding for playground URL The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 759235 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((759235-781842)/781842)=-2.8 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3194173 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3194173-3204351)/3204351)=-0.031 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8151 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8151-8495)/8495)=-4.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69480 after.tar.gz 100*((69480-69600)/69600)=-0.17
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 27, 2023
Rollup of 8 pull requests Successful merges: - rust-lang#105784 (update stdarch) - rust-lang#106856 (core: Support variety of atomic widths in width-agnostic functions) - rust-lang#107171 (rustc_metadata: Fix `encode_attrs`) - rust-lang#107242 (rustdoc: make item links consistently use `title="{shortty} {path}"`) - rust-lang#107279 (Use new solver during selection) - rust-lang#107284 (rustdoc: use smarter encoding for playground URL) - rust-lang#107325 (rustdoc: Stop using `HirId`s) - rust-lang#107336 (rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Feb 9, 2023
…de, r=GuillaumeGomez rustdoc: use the same URL escape rules for fragments as for examples Carries over improvements from rust-lang#107284
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like
cargo doc
.Try it out: https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}
In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031%
100*((759235-781842)/781842)=-2.8
100*((3194173-3204351)/3204351)=-0.031
100*((8151-8495)/8495)=-4.0
Gzipped tarball sizes seem shrunk, but not by much.
100*((69480-69600)/69600)=-0.17