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: use a more compact encoding for implementors/trait.*.js #100150

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Aug 4, 2022

The exact amount that this reduces the size of an implementors file depends on whether most of the impls are synthetic or not. For Send, it reduces the file from 128K to 112K, while for Clone it went from 64K to 44K.

@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

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

r? @jsha

(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 Aug 4, 2022
The exact amount that this reduces the size of an implementors file depends
on whether most of the impls are synthetic or not. For `Send`, it reduces
the file from 128K to 116K, while for `Clone` it went from 64K to 52K.
@GuillaumeGomez
Copy link
Member

Looks good to me but I'm curious about the perf impact so let's check.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 5, 2022
@bors
Copy link
Contributor

bors commented Aug 5, 2022

⌛ Trying commit 513cf86 with merge 0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a...

@bors
Copy link
Contributor

bors commented Aug 5, 2022

☀️ Try build successful - checks-actions
Build commit: 0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a (0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a)

@rust-timer
Copy link
Collaborator

Queued 0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a with parent cdfd675, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
0.6% 0.7% 6
Regressions 😿
(secondary)
0.6% 0.6% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.6% 0.7% 6

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.3% -2.3% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
2.8% 2.8% 1
Regressions 😿
(secondary)
3.9% 3.9% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-4.1% -4.1% 1
All 😿🎉 (primary) 2.8% 2.8% 1

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 5, 2022
@notriddle
Copy link
Contributor Author

The perf impact seems real, probably because of copying Strings around more than necessary. Let's see if using display_fn to write directly to the buffer helps.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 5, 2022
@bors
Copy link
Contributor

bors commented Aug 5, 2022

⌛ Trying commit dddc2fd with merge 10f0d312ef4ea28b6ac22029ff3b9317f55830db...

@bors
Copy link
Contributor

bors commented Aug 5, 2022

☀️ Try build successful - checks-actions
Build commit: 10f0d312ef4ea28b6ac22029ff3b9317f55830db (10f0d312ef4ea28b6ac22029ff3b9317f55830db)

@rust-timer
Copy link
Collaborator

Queued 10f0d312ef4ea28b6ac22029ff3b9317f55830db with parent d77da9d, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (10f0d312ef4ea28b6ac22029ff3b9317f55830db): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
0.6% 1.1% 9
Regressions 😿
(secondary)
0.5% 0.8% 2
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.6% 1.1% 9

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.3% -2.3% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.5% -2.6% 2
All 😿🎉 (primary) N/A N/A 0

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 5, 2022
This means we don't gain as much as we did from using single-quotes, since
serde_json can only produce double-quoted strings, but it's still a win.
@notriddle
Copy link
Contributor Author

Last attempt. If it's not all the string copying, it's probably that serde_json is faster at escaping strings than my naive function was. To try this, I can use serde to implement the same format I was using, except that it uses double-quoted strings, so all the double-quotes in the HTML snippets get backslash escaped. An unfortunate loss, but not a huge deal. Getting rid of the unused data in those files still makes this a huge win.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 6, 2022
@bors
Copy link
Contributor

bors commented Aug 6, 2022

⌛ Trying commit fc31fce with merge 99be0b6d211c5348e69332d895ff73bbcee3d9f1...

@bors
Copy link
Contributor

bors commented Aug 6, 2022

☀️ Try build successful - checks-actions
Build commit: 99be0b6d211c5348e69332d895ff73bbcee3d9f1 (99be0b6d211c5348e69332d895ff73bbcee3d9f1)

@rust-timer
Copy link
Collaborator

Queued 99be0b6d211c5348e69332d895ff73bbcee3d9f1 with parent affe0d3, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (99be0b6d211c5348e69332d895ff73bbcee3d9f1): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
2.1% 2.1% 1
Regressions 😿
(secondary)
2.2% 2.2% 1
Improvements 🎉
(primary)
-1.9% -1.9% 1
Improvements 🎉
(secondary)
-2.7% -2.7% 1
All 😿🎉 (primary) 0.1% 2.1% 2

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
2.4% 2.4% 2
Regressions 😿
(secondary)
3.0% 3.0% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 2.4% 2.4% 2

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Aug 6, 2022
@notriddle notriddle assigned GuillaumeGomez and unassigned jsha Aug 6, 2022
@GuillaumeGomez
Copy link
Member

Congrats for the perf fix, this is really awesome!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 9, 2022

📌 Commit fc31fce 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 9, 2022
@bors
Copy link
Contributor

bors commented Aug 9, 2022

⌛ Testing commit fc31fce with merge 34a6cae...

@bors
Copy link
Contributor

bors commented Aug 9, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 34a6cae to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 9, 2022
@bors bors merged commit 34a6cae into rust-lang:master Aug 9, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 9, 2022
@notriddle notriddle deleted the notriddle/implementors-js branch August 9, 2022 23:53
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (34a6cae): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: ✅ relevant improvement found
mean1 max count2
Regressions ❌
(primary)
N/A N/A 0
Regressions ❌
(secondary)
N/A N/A 0
Improvements ✅
(primary)
N/A N/A 0
Improvements ✅
(secondary)
-1.5% -1.5% 1
All ❌✅ (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: ✅ relevant improvements found
mean1 max count2
Regressions ❌
(primary)
N/A N/A 0
Regressions ❌
(secondary)
N/A N/A 0
Improvements ✅
(primary)
N/A N/A 0
Improvements ✅
(secondary)
-2.6% -5.4% 53
All ❌✅ (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: ✅ relevant improvements found
mean1 max count2
Regressions ❌
(primary)
N/A N/A 0
Regressions ❌
(secondary)
N/A N/A 0
Improvements ✅
(primary)
N/A N/A 0
Improvements ✅
(secondary)
-3.4% -5.4% 8
All ❌✅ (primary) N/A N/A 0

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 3

  2. number of relevant changes 2 3

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