about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-03-04 20:01:03 +0900
committerGitHub <noreply@github.com>2021-03-04 20:01:03 +0900
commit36b7bef1cb0fb9d989f6c6e5ae9f001dea1b6a14 (patch)
treeaa019f79b4c875c607bdd95cb38b5d3929ddb398 /compiler/rustc_mir/src/transform/coverage/graph.rs
parentf898aa3f5b4b7b85b71c4bb5447d0b7cef6deeaf (diff)
parent768d5e950953738a54480e530341964838d29da2 (diff)
downloadrust-36b7bef1cb0fb9d989f6c6e5ae9f001dea1b6a14.tar.gz
rust-36b7bef1cb0fb9d989f6c6e5ae9f001dea1b6a14.zip
Rollup merge of #82310 - jsha:rustdoc-search-onfocus, r=GuillaumeGomez
Load rustdoc's JS search index on-demand.

Instead of being loaded on every page, the JS search index is now loaded when either (a) there is a `?search=` param, or (b) the search input is focused.

This saves both CPU and bandwidth. As of Feb 2021, https://doc.rust-lang.org/search-index1.50.0.js is 273,838 bytes gzipped or 2,544,939 bytes uncompressed. Evaluating it takes 445 ms of CPU time in Chrome 88 on a i7-10710U CPU (out of a total ~2,100 ms page reload).

Tested on Firefox and Chrome.

New:
https://jacob.hoffman-andrews.com/rust/search-on-demand/std/primitive.slice.html
https://jacob.hoffman-andrews.com/rust/search-on-demand/std/primitive.slice.html?search=fn

Old:
https://jacob.hoffman-andrews.com/rust/search-on-load/std/primitive.slice.html
https://jacob.hoffman-andrews.com/rust/search-on-load/std/primitive.slice.html?search=fn
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions