Skip to content

rustdoc: link sibling where possible, even when not One True Path#124102

Closed
notriddle wants to merge 2 commits into
rust-lang:masterfrom
notriddle:notriddle/sibling-link
Closed

rustdoc: link sibling where possible, even when not One True Path#124102
notriddle wants to merge 2 commits into
rust-lang:masterfrom
notriddle:notriddle/sibling-link

Conversation

@notriddle

Copy link
Copy Markdown
Contributor

This is, first of all, a size hack aimed at the core::arch modules that share items (x86-64/x86, aarch64/x86). They inline a lot of items from shared modules, and if we can avoid writing ../arm/WHATEVER all over the aarch64 module, we can shave a few bytes off every link.

Also, clicking a link in the 64 bit module and landing in the 32 bit module makes no sense.

@rustbot

rustbot commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

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 Apr 18, 2024
@notriddle notriddle force-pushed the notriddle/sibling-link branch from 7e29512 to 902e39d Compare April 18, 2024 01:32
@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #124008) made this pull request unmergeable. Please resolve the merge conflicts.

Comment thread src/librustdoc/html/format.rs Outdated
@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks! r=me once merge conflicts have been resolved.

This is, first of all, a size hack aimed at the `core::arch`
modules that share items (x86-64/x86, aarch64/x86). They
inline a lot of items from shared modules, and if we can
avoid writing `../arm/WHATEVER` all over the aarch64 module,
we can shave a few bytes off every link.

Also, clicking a link in the 64 bit module and landing in
the 32 bit module makes no sense.
@notriddle notriddle force-pushed the notriddle/sibling-link branch from ba76594 to aeeb197 Compare April 18, 2024 16:58
@notriddle

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2024
…<try>

rustdoc: link sibling where possible, even when not One True Path

This is, first of all, a size hack aimed at the `core::arch` modules that share items (x86-64/x86, aarch64/x86). They inline a lot of items from shared modules, and if we can avoid writing `../arm/WHATEVER` all over the aarch64 module, we can shave a few bytes off every link.

Also, clicking a link in the 64 bit module and landing in the 32 bit module makes no sense.
@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

⌛ Trying commit aeeb197 with merge bfb0a95...

@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: bfb0a95 (bfb0a95051fee4201e00ff20dec4f7609fdbf6ee)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (bfb0a95): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.6% [0.3%, 7.7%] 4
Regressions ❌
(secondary)
3.1% [2.2%, 4.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [0.3%, 7.7%] 4

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
171.2% [15.6%, 319.1%] 3
Regressions ❌
(secondary)
54.4% [5.5%, 103.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 171.2% [15.6%, 319.1%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
10.2% [3.3%, 17.2%] 2
Regressions ❌
(secondary)
3.9% [3.5%, 4.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.2% [3.3%, 17.2%] 2

Binary size

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

Bootstrap: 676.731s -> 676.763s (0.00%)
Artifact size: 316.11 MiB -> 315.33 MiB (-0.25%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 18, 2024
@GuillaumeGomez

Copy link
Copy Markdown
Member

The impact on libc is quite huge (especially on memory).

This changes things so that it only gets inlined items added,
instead of populating it with redundant parts.
This is a workaround for `libc`, which has a bunch of items
that get re-exported in one place.
@notriddle

Copy link
Copy Markdown
Contributor Author

Yeah, that's way more than acceptable. It also doesn't seem like libc's output has changed at all.

Since that probably means that its items are being inlined into exactly one place and this patch isn't doing anything. Maybe it would fix the regression if rustdoc skipped populating the map? 2868cea

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 18, 2024
@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 2868cea with merge 620d812...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2024
…<try>

rustdoc: link sibling where possible, even when not One True Path

This is, first of all, a size hack aimed at the `core::arch` modules that share items (x86-64/x86, aarch64/x86). They inline a lot of items from shared modules, and if we can avoid writing `../arm/WHATEVER` all over the aarch64 module, we can shave a few bytes off every link.

Also, clicking a link in the 64 bit module and landing in the 32 bit module makes no sense.
@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 620d812 (620d81217e6b871206e01698678714a7d789b48f)

1 similar comment
@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 620d812 (620d81217e6b871206e01698678714a7d789b48f)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (620d812): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.6% [0.3%, 7.7%] 4
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [0.3%, 7.7%] 4

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
128.8% [0.9%, 318.4%] 4
Regressions ❌
(secondary)
101.5% [101.5%, 101.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 128.8% [0.9%, 318.4%] 4

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
10.6% [3.5%, 17.7%] 2
Regressions ❌
(secondary)
4.8% [4.8%, 4.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.6% [3.5%, 17.7%] 2

Binary size

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

Bootstrap: 672.221s -> 672.962s (0.11%)
Artifact size: 315.28 MiB -> 315.31 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 19, 2024
@notriddle

Copy link
Copy Markdown
Contributor Author

That didn't help.

Might need to go back to the drawing board here...

@notriddle notriddle closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants