rust/src/librustdoc/html
Michael Howell 51df99f3c2 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
2023-01-26 10:51:10 -07:00
..
highlight rustdoc: rename syntax highlighting CSS class attribute to attr 2022-10-31 13:55:39 -07:00
length_limit Don't panic if close_tag() is called without tags to close 2021-08-25 20:09:17 -07:00
markdown Extend rustdoc hashtag prepended line test 2022-12-11 14:39:09 +01:00
render rustdoc: Use DefId(Map,Set) instead of FxHash(Map,Set) 2023-01-22 02:12:05 +04:00
static Rollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle 2023-01-23 11:52:05 +05:30
templates rustdoc: remove unnecessary DOM class h1.fqn 2023-01-13 10:09:25 -07:00
toc Format the world 2019-12-22 17:42:47 -05:00
url_parts_builder Document and test UrlPartsBuilder::push_fmt 2022-01-14 12:05:35 -08:00
escape.rs Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00
format.rs rustdoc: simplify some & ref erences 2023-01-15 15:23:30 +01:00
highlight.rs Clean up lifetimes in rustdoc syntax highlighting 2022-12-10 14:04:09 +01:00
layout.rs Fix rustdoc --version when used with download-rustc 2022-11-09 02:54:51 -06:00
length_limit.rs Don't panic if close_tag() is called without tags to close 2021-08-25 20:09:17 -07:00
markdown.rs rustdoc: use smarter encoding for playground URL 2023-01-26 10:51:10 -07:00
mod.rs Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00
sources.rs Correctly render sidebar for relative module paths 2023-01-06 16:48:13 +00:00
static_files.rs Fix UI issues with Rustdoc scrape-examples feature. 2022-11-26 22:04:45 -06:00
tests.rs rustdoc: avoid many Symbol to String conversions. 2022-01-14 11:57:18 -08:00
toc.rs fix clippy perf lints 2022-05-24 13:35:54 -04:00
url_parts_builder.rs Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00