-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc-search: use tighter json for names and parents #129426
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
rustbot has assigned @GuillaumeGomez. Use |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
Apart from the nit, looks good to me. Just a bit sad that we have yet again a perf (although very small) reduction in the JS. |
dd409ad
to
7009193
Compare
Thanks! r=me once CI pass. |
What do you mean? I'm seeing it inconsistent: sometimes slower and sometimes faster. |
This comment has been minimized.
This comment has been minimized.
File size --------- ```console $ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js 3.2M doc.old/search-index1.82.0.js 2.8M doc/search-index1.82.0.js $ gzip doc/search-index1.82.0.js $ gzip doc.old/search-index1.82.0.js $ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz 464K doc.old/search-index1.82.0.js.gz 456K doc/search-index1.82.0.js.gz $ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js 8.5M compiler-doc.old/search-index.js 6.5M compiler-doc/search-index.js $ gzip compiler-doc/search-index1.82.0.js $ gzip compiler-doc.old/search-index1.82.0.js $ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz 1.4M compiler-doc.old/search-index.js.gz 1.4M compiler-doc/search-index.js.gz ```
7009193
to
8151de2
Compare
I simply looked at the benchmark results you posted. It seems overall to tend to be a bit slower. But I'm not sure how reliable these results are. Maybe if there was an equivalent to instructions count, that'd be awesome, but I doubt JS allows to query this information... |
I re-checked and you're right, nothing big enough to not be considered noise. Not sure why I was thinking overall it seemed to be slower, there is no consistency in this regard, sorry about that. So like I said, r=me once CI pass and thanks for the size improvement! |
@bors r=GuillaumeGomez |
…, r=GuillaumeGomez rustdoc-search: use tighter json for names and parents File size --------- ```console $ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js 3.2M doc.old/search-index1.82.0.js 2.8M doc/search-index1.82.0.js $ gzip doc/search-index1.82.0.js $ gzip doc.old/search-index1.82.0.js $ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz 464K doc.old/search-index1.82.0.js.gz 456K doc/search-index1.82.0.js.gz $ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js 8.5M compiler-doc.old/search-index.js 6.5M compiler-doc/search-index.js $ gzip compiler-doc/search-index1.82.0.js $ gzip compiler-doc.old/search-index1.82.0.js $ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz 1.4M compiler-doc.old/search-index.js.gz 1.4M compiler-doc/search-index.js.gz ``` Performance ----------- Firefox profile: [before](https://profiler.firefox.com/public/jf1741wycma0n38asdf7kdtw8egs0pqakbr03jg/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10), [after](https://profiler.firefox.com/public/p4fptad7vncsfgrgk9a18yx7m6w8kdpgfy15f8r/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10) CLI profiler scripts comparison: https://notriddle.com/rustdoc-html-demo-9/smaller-index-2024-08-22/index.html | Benchmark | Before | After | % Diff | --------- | ----------:| ----------:| ------: | arti | 225692 KiB | 218744 KiB | 3% | cortex-m | 58276 KiB | 57852 KiB | 0% | sqlx | 123132 KiB | 125448 KiB | -2% | stm32f4 | 556828 KiB | 548996 KiB | 1% | ripgrep | 86964 KiB | 86180 KiB | 1%
Rollup of 7 pull requests Successful merges: - rust-lang#128192 (rustc_target: Add various aarch64 features) - rust-lang#128507 (Migrate `libtest-thread-limit` `run-make` test to rmake) - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs) - rust-lang#129276 (Stabilize feature `char_indices_offset`) - rust-lang#129350 (adapt integer comparison tests for LLVM 20 IR changes) - rust-lang#129414 (Fix extern crates not being hidden with `doc(hidden)`) - rust-lang#129426 (rustdoc-search: use tighter json for names and parents) r? `@ghost` `@rustbot` modify labels: rollup
…, r=GuillaumeGomez rustdoc-search: use tighter json for names and parents File size --------- ```console $ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js 3.2M doc.old/search-index1.82.0.js 2.8M doc/search-index1.82.0.js $ gzip doc/search-index1.82.0.js $ gzip doc.old/search-index1.82.0.js $ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz 464K doc.old/search-index1.82.0.js.gz 456K doc/search-index1.82.0.js.gz $ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js 8.5M compiler-doc.old/search-index.js 6.5M compiler-doc/search-index.js $ gzip compiler-doc/search-index1.82.0.js $ gzip compiler-doc.old/search-index1.82.0.js $ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz 1.4M compiler-doc.old/search-index.js.gz 1.4M compiler-doc/search-index.js.gz ``` Performance ----------- Firefox profile: [before](https://profiler.firefox.com/public/jf1741wycma0n38asdf7kdtw8egs0pqakbr03jg/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10), [after](https://profiler.firefox.com/public/p4fptad7vncsfgrgk9a18yx7m6w8kdpgfy15f8r/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10) CLI profiler scripts comparison: https://notriddle.com/rustdoc-html-demo-9/smaller-index-2024-08-22/index.html | Benchmark | Before | After | % Diff | --------- | ----------:| ----------:| ------: | arti | 225692 KiB | 218744 KiB | 3% | cortex-m | 58276 KiB | 57852 KiB | 0% | sqlx | 123132 KiB | 125448 KiB | -2% | stm32f4 | 556828 KiB | 548996 KiB | 1% | ripgrep | 86964 KiB | 86180 KiB | 1%
…llaumeGomez Rollup of 9 pull requests Successful merges: - rust-lang#128511 (Document WebAssembly target feature expectations) - rust-lang#129243 (do not build `cargo-miri` by default on stable channel) - rust-lang#129263 (Add a missing compatibility note in the 1.80.0 release notes) - rust-lang#129276 (Stabilize feature `char_indices_offset`) - rust-lang#129350 (adapt integer comparison tests for LLVM 20 IR changes) - rust-lang#129408 (Fix handling of macro arguments within the `dropping_copy_types` lint) - rust-lang#129426 (rustdoc-search: use tighter json for names and parents) - rust-lang#129437 (Fix typo in a help diagnostic) - rust-lang#129457 (kobzol vacation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#129426 - notriddle:smaller-index-2024-08-22, r=GuillaumeGomez rustdoc-search: use tighter json for names and parents File size --------- ```console $ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js 3.2M doc.old/search-index1.82.0.js 2.8M doc/search-index1.82.0.js $ gzip doc/search-index1.82.0.js $ gzip doc.old/search-index1.82.0.js $ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz 464K doc.old/search-index1.82.0.js.gz 456K doc/search-index1.82.0.js.gz $ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js 8.5M compiler-doc.old/search-index.js 6.5M compiler-doc/search-index.js $ gzip compiler-doc/search-index1.82.0.js $ gzip compiler-doc.old/search-index1.82.0.js $ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz 1.4M compiler-doc.old/search-index.js.gz 1.4M compiler-doc/search-index.js.gz ``` Performance ----------- Firefox profile: [before](https://profiler.firefox.com/public/jf1741wycma0n38asdf7kdtw8egs0pqakbr03jg/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10), [after](https://profiler.firefox.com/public/p4fptad7vncsfgrgk9a18yx7m6w8kdpgfy15f8r/calltree/?globalTrackOrder=0w3&implementation=js&thread=3&v=10) CLI profiler scripts comparison: https://notriddle.com/rustdoc-html-demo-9/smaller-index-2024-08-22/index.html | Benchmark | Before | After | % Diff | --------- | ----------:| ----------:| ------: | arti | 225692 KiB | 218744 KiB | 3% | cortex-m | 58276 KiB | 57852 KiB | 0% | sqlx | 123132 KiB | 125448 KiB | -2% | stm32f4 | 556828 KiB | 548996 KiB | 1% | ripgrep | 86964 KiB | 86180 KiB | 1%
File size
Performance
Firefox profile: before, after
CLI profiler scripts comparison: https://notriddle.com/rustdoc-html-demo-9/smaller-index-2024-08-22/index.html