about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-19 22:31:50 +1000
committerGitHub <noreply@github.com>2025-09-19 22:31:50 +1000
commitfe0b51939cbe0a52182fdc9916c10f233d1a5c15 (patch)
tree0c117d9f80463f52a1009a9fe6cd873201aa0b44 /compiler/rustc_codegen_llvm/src
parentac9b55e439fe2277f1624158158c5e09c2f688cd (diff)
parent277e845162299d533ce64a2a6dfa540d4f36fb30 (diff)
downloadrust-fe0b51939cbe0a52182fdc9916c10f233d1a5c15.tar.gz
rust-fe0b51939cbe0a52182fdc9916c10f233d1a5c15.zip
Rollup merge of #146484 - notriddle:stringdex-js-opt, r=GuillaumeGomez
rustdoc-search: JavaScript optimization based on Firefox Profiler output

Part of https://github.com/rust-lang/rust/issues/146048

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html

These commits are based on some profiler readings, and should reduce CPU usage for name-based searching.

- The first commit improves warm searches by allocating less garbage when data is already loaded:

  Before: https://profiler.firefox.com/public/wvzd88m8r70p8frvz1z628tv3htwna0b9c0ef10/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

  After: https://profiler.firefox.com/public/yfe9aq6ep3kacw3zmr7jqn6gv7ckfq86rg89568/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

- The second commit improves cold searches by delaying load for special type names until type-based search runs

  Before: 5.86s (throttled to "Good 2G" in Dev Tools) <https://doc.rust-lang.org/nightly/std/index.html?search=>

  <img width="2524" height="919" alt="image" src="https://github.com/user-attachments/assets/8dbbbd46-b7ab-4e3c-9e8c-f1e41cfaa968" />

  After: 5.77s (throttled to "Good 2G" in Dev Tools) <https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html?search=>

  <img width="2524" height="912" alt="image" src="https://github.com/user-attachments/assets/6976a584-24f4-4d47-8118-7a81b22d411e" />

  For comparison's sake, the same test takes 12.17s on stable <https://doc.rust-lang.org/1.89.0/std/index.html?search=>

    <img width="2525" height="916" alt="image" src="https://github.com/user-attachments/assets/eb6df2e8-6632-4bef-a6d0-5179c6288fd0" />
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions