rust icon indicating copy to clipboard operation
rust copied to clipboard

rustdoc: use a more compact encoding for implementors/trait.*.js

Open notriddle opened this issue 3 years ago β€’ 20 comments

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.

notriddle avatar Aug 04 '22 20:08 notriddle

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

rustbot avatar Aug 04 '22 20:08 rustbot

r? @jsha

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

rust-highfive avatar Aug 04 '22 20:08 rust-highfive

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

@bors try @rust-timer queue

GuillaumeGomez avatar Aug 05 '22 09:08 GuillaumeGomez

Awaiting bors try build completion.

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

rust-timer avatar Aug 05 '22 09:08 rust-timer

:hourglass: Trying commit 513cf8664ab074d0fa540f1e1661193aeff0d358 with merge 0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a...

bors avatar Aug 05 '22 09:08 bors

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

bors avatar Aug 05 '22 11:08 bors

Queued 0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a with parent cdfd675a63090182fd1c5f2ff58d8eaa115da156, future comparison URL.

rust-timer avatar Aug 05 '22 11:08 rust-timer

Finished benchmarking commit (0c2c82bf492f1dcb836c5bb4c4c3226aeaee389a): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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

[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes

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

rust-timer avatar Aug 05 '22 13:08 rust-timer

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

notriddle avatar Aug 05 '22 16:08 notriddle

Awaiting bors try build completion.

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

rust-timer avatar Aug 05 '22 16:08 rust-timer

:hourglass: Trying commit dddc2fd6de3db11eeeb244e0ac5754c49f9ad11b with merge 10f0d312ef4ea28b6ac22029ff3b9317f55830db...

bors avatar Aug 05 '22 16:08 bors

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

bors avatar Aug 05 '22 18:08 bors

Queued 10f0d312ef4ea28b6ac22029ff3b9317f55830db with parent d77da9da84fc89908ad01578c33c2dca8f597ffe, future comparison URL.

rust-timer avatar Aug 05 '22 18:08 rust-timer

Finished benchmarking commit (10f0d312ef4ea28b6ac22029ff3b9317f55830db): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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

[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes

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

rust-timer avatar Aug 05 '22 19:08 rust-timer

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

notriddle avatar Aug 06 '22 00:08 notriddle

Awaiting bors try build completion.

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

rust-timer avatar Aug 06 '22 00:08 rust-timer

:hourglass: Trying commit fc31fce670ad76db14044a519a15870347253766 with merge 99be0b6d211c5348e69332d895ff73bbcee3d9f1...

bors avatar Aug 06 '22 00:08 bors

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

bors avatar Aug 06 '22 02:08 bors

Queued 99be0b6d211c5348e69332d895ff73bbcee3d9f1 with parent affe0d3a00e92fa7885e3f5d2c5073fde432d154, future comparison URL.

rust-timer avatar Aug 06 '22 02:08 rust-timer

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
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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

[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes

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

rust-timer avatar Aug 06 '22 04:08 rust-timer

Congrats for the perf fix, this is really awesome!

@bors r+

GuillaumeGomez avatar Aug 09 '22 09:08 GuillaumeGomez

:pushpin: Commit fc31fce670ad76db14044a519a15870347253766 has been approved by GuillaumeGomez

It is now in the queue for this repository.

bors avatar Aug 09 '22 09:08 bors

:hourglass: Testing commit fc31fce670ad76db14044a519a15870347253766 with merge 34a6cae28e7013ff0e640026a8e46f315426829d...

bors avatar Aug 09 '22 20:08 bors

:sunny: Test successful - checks-actions Approved by: GuillaumeGomez Pushing 34a6cae28e7013ff0e640026a8e46f315426829d to master...

bors avatar Aug 09 '22 22:08 bors

Finished benchmarking commit (34a6cae28e7013ff0e640026a8e46f315426829d): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: βœ… relevant improvement found
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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
mean[^1] max count[^2]
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

[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes

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

@rustbot label: -perf-regression

rust-timer avatar Aug 10 '22 00:08 rust-timer