-
Couldn't load subscription status.
- Fork 13.9k
rustdoc-search: JavaScript optimization based on Firefox Profiler output #146484
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
Conversation
This commit is a mirrored change from stringdex that makes `at()` not always return a promise, which is fine because we can still `await` it.
|
Some changes occurred in HTML/CSS/JS. |
|
rustbot has assigned @GuillaumeGomez. Use |
This comment has been minimized.
This comment has been minimized.
This avoids blocking on these lookups, so name-based searches return results more quickly.
51784af to
277e845
Compare
|
This is great and there a lot of code comments, so thanks a lot for this PR! @bors r+ rollup |
Rollup of 10 pull requests Successful merges: - #146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set) - #146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output) - #146541 (std: simplify host lookup) - #146615 (rustc_codegen_llvm: Feature Conversion Tidying) - #146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`) - #146663 (Allow windows resource compiler to be overridden) - #146691 (std: Fix WASI implementation of `remove_dir_all`) - #146709 (stdarch subtree update) - #146738 (Fix tidy spellchecking on Windows) - #146740 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #146484 - notriddle:stringdex-js-opt, r=GuillaumeGomez rustdoc-search: JavaScript optimization based on Firefox Profiler output Part of #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" />
Rollup of 10 pull requests Successful merges: - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set) - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output) - rust-lang/rust#146541 (std: simplify host lookup) - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying) - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`) - rust-lang/rust#146663 (Allow windows resource compiler to be overridden) - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`) - rust-lang/rust#146709 (stdarch subtree update) - rust-lang/rust#146738 (Fix tidy spellchecking on Windows) - rust-lang/rust#146740 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…laumeGomez rustdoc-search: JavaScript optimization based on Firefox Profiler output Part of rust-lang#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" />
Rollup of 10 pull requests Successful merges: - rust-lang#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set) - rust-lang#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output) - rust-lang#146541 (std: simplify host lookup) - rust-lang#146615 (rustc_codegen_llvm: Feature Conversion Tidying) - rust-lang#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`) - rust-lang#146663 (Allow windows resource compiler to be overridden) - rust-lang#146691 (std: Fix WASI implementation of `remove_dir_all`) - rust-lang#146709 (stdarch subtree update) - rust-lang#146738 (Fix tidy spellchecking on Windows) - rust-lang#146740 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
[stable] Prepare Rust 1.91.0 release - [beta-1.91] Add more context to the temporary lifetime extension FCW #148174 - rustdoc-search: JavaScript optimization based on Firefox Profiler output #146484 - rustdoc-search: use the same ID for entry and path to same item #147045 - rustdoc-search: stringdex update with more packing #147002 - rustdoc-search: stringdex 0.0.2 #147660 - [beta] Clippy beta backport #148029 - 1.91.0 release notes #148013 r? cuviper
Part of #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=
After: 5.77s (throttled to "Good 2G" in Dev Tools) https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html?search=
For comparison's sake, the same test takes 12.17s on stable https://doc.rust-lang.org/1.89.0/std/index.html?search=