rustdoc-search: use tighter json for names and parents by notriddle · Pull Request #129426 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation12 Commits1 Checks6 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

notriddle

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

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

GuillaumeGomez

@GuillaumeGomez

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

@GuillaumeGomez

Thanks! r=me once CI pass.

@notriddle

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.

@notriddle

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

@GuillaumeGomez

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

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

@bors

📌 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

@tgross35

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 23, 2024

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request

Aug 23, 2024

@GuillaumeGomez

This was referenced

Aug 23, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 23, 2024

@bors

…llaumeGomez

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Aug 23, 2024

@rust-timer

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.