Skip to content

Commit 3417880

Browse files
authored
Rollup merge of #146484 - notriddle:stringdex-js-opt, r=GuillaumeGomez
rustdoc-search: JavaScript optimization based on Firefox Profiler output Part of rust-lang/rust#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" />
2 parents 7527c2a + 87e874d commit 3417880

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)