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: reference function signature types from the p array #98475

Merged
merged 6 commits into from
Jun 29, 2022

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Jun 25, 2022

This reduces the size of the function signature index, because it's common to have many functions that operate on the same types.

$ wc -c search-index-old.js search-index-new.js
5224374 search-index-old.js
3932314 search-index-new.js

By my math, this reduces the uncompressed size of the search index by 32%.
On compressed signatures, the wins are less drastic, a mere 8%:

$ wc -c search-index-old.js.gz search-index-new.js.gz
404532 search-index-old.js.gz
371635 search-index-new.js.gz

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 25, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez,@Folyd,@jsha

Some changes occurred in clean/types.rs.

cc @camelid

@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 25, 2022
This reduces the size of the function signature index, because
it's common to have many functions that operate on the same types.

    $ wc -c search-index-old.js search-index-new.js
    5224374 search-index-old.js
    3932314 search-index-new.js

By my math, this reduces the uncompressed size of the search index by 32%.
On compressed signatures, the wins are less drastic, a mere 8%:

    $ wc -c search-index-old.js.gz search-index-new.js.gz
    404532 search-index-old.js.gz
    371635 search-index-new.js.gz
@notriddle notriddle force-pushed the notriddle/index-fn-signatures branch from e64f1e7 to dc1fc08 Compare June 25, 2022 01:16
@GuillaumeGomez
Copy link
Member

Changes look good to me. Do you have an online version by any chance?

@notriddle
Copy link
Contributor Author

notriddle commented Jun 26, 2022

@Folyd
Copy link
Contributor

Folyd commented Jun 27, 2022

This is so good. I hope this PR wouldn't break my extension, haha. 😄

@notriddle
Copy link
Contributor Author

This is so good. I hope this PR wouldn't break my extension, haha. 😄

It depends on whether you use the f array, which contains the data used by Input -> Output style searches. If you only support searching by name, then this shouldn't affect you at all.

@notriddle notriddle force-pushed the notriddle/index-fn-signatures branch from 579a13d to 6f9a460 Compare June 27, 2022 18:21
@GuillaumeGomez
Copy link
Member

Still this question:

Btw, why 0 and not null?

Apart from that, looks really great. :)

@notriddle
Copy link
Contributor Author

Btw, why 0 and not null?

null is four bytes, while 0 is one byte.

@GuillaumeGomez
Copy link
Member

Please add this explanation then. :)

@notriddle notriddle force-pushed the notriddle/index-fn-signatures branch from f8f23fe to 33cf9ea Compare June 27, 2022 21:15
@GuillaumeGomez
Copy link
Member

Thanks, it's awesome! r=me once CI pass.

@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez rollup=never

This might have a perf impact. Even if it's a sizeable regression, it would probably be worth it, but we still don't want it included in a rollup.

@bors
Copy link
Contributor

bors commented Jun 27, 2022

📌 Commit 33cf9ea has been approved by GuillaumeGomez

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 27, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 27, 2022
@bors
Copy link
Contributor

bors commented Jun 28, 2022

⌛ Testing commit 33cf9ea with merge 2953edc...

@bors
Copy link
Contributor

bors commented Jun 29, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 2953edc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 29, 2022
@bors bors merged commit 2953edc into rust-lang:master Jun 29, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jun 29, 2022
@notriddle notriddle deleted the notriddle/index-fn-signatures branch June 29, 2022 00:21
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2953edc): comparison url.

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.1% 3.5% 3
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.1% -2.1% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
3.1% 3.1% 1
Regressions 😿
(secondary)
2.5% 2.5% 1
Improvements 🎉
(primary)
-2.8% -3.2% 2
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -0.9% -3.2% 3

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants