Skip to content
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

rustdoc-search: use tighter json for names and parents #129426

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Aug 22, 2024

File size

$ 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, after

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%

@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2024

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 22, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@GuillaumeGomez
Copy link
Member

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.

@GuillaumeGomez
Copy link
Member

Thanks! r=me once CI pass.

@notriddle
Copy link
Contributor Author

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.

What do you mean? I'm seeing it inconsistent: sometimes slower and sometimes faster.

@rust-log-analyzer

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
```
@GuillaumeGomez
Copy link
Member

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...

@GuillaumeGomez
Copy link
Member

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!

@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Aug 22, 2024

📌 Commit 8151de2 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 23, 2024
…, 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%
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 23, 2024
…, 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%
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
…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
@bors bors merged commit db65b6c into rust-lang:master Aug 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
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%
@notriddle notriddle deleted the smaller-index-2024-08-22 branch August 23, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants