Skip to content

rustdoc: Fix performance regression for private documented items - #164989

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
GuillaumeGomez:rustdoc-doc-private-perf
Oct 31, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
GuillaumeGomez:rustdoc-doc-private-perf

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Should help with #161362.

The idea is to not (doc) inline private reexports by default. That will save us a lot of cleaning for external items and for html pages generation.

r? ghost

@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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 26, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member 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 Oct 26, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 26, 2026
rustdoc: Fix performance regression for private documented items
@rust-bors

rust-bors Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9ddb950 (9ddb950ce4342306fbe98df20021c4cc4ef6b29d)
Base parent: 019b59d (019b59d8101bb3e141f1b880684747b4217beeb6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9ddb950): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=iffy rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-3.4% [-5.1%, -1.8%] 2
Improvements ✅
(secondary)
-30.8% [-59.9%, -1.8%] 2
All ❌✅ (primary) -3.4% [-5.1%, -1.8%] 2

Max RSS (memory usage)

Results (primary 0.2%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.3%] 5
Regressions ❌
(secondary)
2.1% [1.8%, 2.3%] 4
Improvements ✅
(primary)
-0.8% [-1.4%, -0.4%] 3
Improvements ✅
(secondary)
-8.0% [-8.0%, -8.0%] 1
All ❌✅ (primary) 0.2% [-1.4%, 1.3%] 8

Cycles

Results (primary -0.9%, secondary -19.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [0.5%, 2.4%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-3.3%, -0.4%] 20
Improvements ✅
(secondary)
-19.5% [-52.9%, -2.7%] 3
All ❌✅ (primary) -0.9% [-3.3%, 2.4%] 25

Binary size

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 489.601s -> 488.841s (-0.16%)
Artifact size: 405.81 MiB -> 406.05 MiB (0.06%)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I have some ideas on how to improve it further but as a first step I think it's good enough.

r? @Urgau

@Urgau

Urgau commented Oct 27, 2026

Copy link
Copy Markdown
Member

I don't have enough context to know all the implications of this change. r? rustdoc

@rustbot rustbot assigned notriddle and unassigned Urgau Oct 27, 2026
Comment thread src/librustdoc/visit_ast.rs Outdated
};

let is_private = !self.cx.cache.effective_visibilities.is_directly_public(tcx, ori_res_did);
let is_private = (is_glob || !self.cx.document_private())

@notriddle notriddle Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you’re going to change what the variable means, change its name, too.

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done!

@notriddle

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ff245b9 has been approved by notriddle

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Oct 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 30, 2026
…-perf, r=notriddle

rustdoc: Fix performance regression for private documented items

Should help with rust-lang#161362.

The idea is to not (doc) inline private reexports by default. That will save us a lot of `clean`ing for external items and for html pages generation.

r? ghost
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 30, 2026
…-perf, r=notriddle

rustdoc: Fix performance regression for private documented items

Should help with rust-lang#161362.

The idea is to not (doc) inline private reexports by default. That will save us a lot of `clean`ing for external items and for html pages generation.

r? ghost
rust-bors Bot pushed a commit that referenced this pull request Oct 30, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #164851 (Add behavior tests for `Arc` and `Rc`)
 - #164989 (rustdoc: Fix performance regression for private documented items)
 - #165079 (Remove GenericArgRef)
 - #161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - #162754 (optimize large elements for slice rotating)
 - #163252 (Remove windows-targets dependency from the root workspace)
 - #163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - #165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - #165132 (Implement `advance_back_by` on `Fuse`)
 - #165142 (Remove the unused generic Graphviz writer)
 - #163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - #163802 (fix RegionEq direction in canonical query responses)
 - #163986 (omit unconditionally invoking crate level limits query)
 - #164920 (Point at prior token on `let` when expression is expected)
 - #164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - #165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - #165114 (use native interpreter impl for funnel shifts intrinsics)
 - #165119 (remove unnecessary fast path from borrowck)
 - #165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - #165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - #165129 (Fix ICE in prelude edition lint)

Failed merges:

 - #164981 (Reflection add TypeId::name)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 30, 2026
…-perf, r=notriddle

rustdoc: Fix performance regression for private documented items

Should help with rust-lang#161362.

The idea is to not (doc) inline private reexports by default. That will save us a lot of `clean`ing for external items and for html pages generation.

r? ghost
rust-bors Bot pushed a commit that referenced this pull request Oct 30, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #164851 (Add behavior tests for `Arc` and `Rc`)
 - #164989 (rustdoc: Fix performance regression for private documented items)
 - #165079 (Remove GenericArgRef)
 - #161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - #162754 (optimize large elements for slice rotating)
 - #163252 (Remove windows-targets dependency from the root workspace)
 - #163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - #165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - #165132 (Implement `advance_back_by` on `Fuse`)
 - #165142 (Remove the unused generic Graphviz writer)
 - #165148 (ci: increase free disk space on macos-26 jobs)
 - #163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - #163802 (fix RegionEq direction in canonical query responses)
 - #163986 (omit unconditionally invoking crate level limits query)
 - #164920 (Point at prior token on `let` when expression is expected)
 - #164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - #165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - #165114 (use native interpreter impl for funnel shifts intrinsics)
 - #165119 (remove unnecessary fast path from borrowck)
 - #165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - #165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - #165129 (Fix ICE in prelude edition lint)

Failed merges:

 - #164981 (Reflection add TypeId::name)

> [!WARNING]
> This rollup conflicts with pending auto build #165205 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #164851 (Add behavior tests for `Arc` and `Rc`)
 - #164989 (rustdoc: Fix performance regression for private documented items)
 - #165079 (Remove GenericArgRef)
 - #161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - #162754 (optimize large elements for slice rotating)
 - #163252 (Remove windows-targets dependency from the root workspace)
 - #163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - #165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - #165132 (Implement `advance_back_by` on `Fuse`)
 - #165142 (Remove the unused generic Graphviz writer)
 - #165148 (ci: increase free disk space on macos-26 jobs)
 - #163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - #163802 (fix RegionEq direction in canonical query responses)
 - #163986 (omit unconditionally invoking crate level limits query)
 - #164920 (Point at prior token on `let` when expression is expected)
 - #164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - #165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - #165114 (use native interpreter impl for funnel shifts intrinsics)
 - #165119 (remove unnecessary fast path from borrowck)
 - #165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - #165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - #165129 (Fix ICE in prelude edition lint)

Failed merges:

 - #164981 (Reflection add TypeId::name)

> [!WARNING]
> This rollup conflicts with pending auto build #165205 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #164851 (Add behavior tests for `Arc` and `Rc`)
 - #164989 (rustdoc: Fix performance regression for private documented items)
 - #165079 (Remove GenericArgRef)
 - #161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - #162754 (optimize large elements for slice rotating)
 - #163252 (Remove windows-targets dependency from the root workspace)
 - #163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - #165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - #165132 (Implement `advance_back_by` on `Fuse`)
 - #165142 (Remove the unused generic Graphviz writer)
 - #165148 (ci: increase free disk space on macos-26 jobs)
 - #163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - #163802 (fix RegionEq direction in canonical query responses)
 - #163986 (omit unconditionally invoking crate level limits query)
 - #164920 (Point at prior token on `let` when expression is expected)
 - #164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - #165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - #165114 (use native interpreter impl for funnel shifts intrinsics)
 - #165119 (remove unnecessary fast path from borrowck)
 - #165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - #165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - #165129 (Fix ICE in prelude edition lint)

Failed merges:

 - #164981 (Reflection add TypeId::name)

> [!WARNING]
> This rollup conflicts with pending auto build #165205 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #164851 (Add behavior tests for `Arc` and `Rc`)
 - #164989 (rustdoc: Fix performance regression for private documented items)
 - #165079 (Remove GenericArgRef)
 - #161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - #162754 (optimize large elements for slice rotating)
 - #163252 (Remove windows-targets dependency from the root workspace)
 - #163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - #165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - #165132 (Implement `advance_back_by` on `Fuse`)
 - #165142 (Remove the unused generic Graphviz writer)
 - #165233 (Remove test-aarch64-apple-* jobs temporarily)
 - #163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - #163802 (fix RegionEq direction in canonical query responses)
 - #163986 (omit unconditionally invoking crate level limits query)
 - #164920 (Point at prior token on `let` when expression is expected)
 - #164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - #165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - #165114 (use native interpreter impl for funnel shifts intrinsics)
 - #165119 (remove unnecessary fast path from borrowck)
 - #165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - #165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - #165129 (Fix ICE in prelude edition lint)

> [!WARNING]
> This rollup conflicts with pending auto build #165217 and may need to be recreated if the pending build succeeds.
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
Rollup merge of #164989 - GuillaumeGomez:rustdoc-doc-private-perf, r=notriddle

rustdoc: Fix performance regression for private documented items

Should help with #161362.

The idea is to not (doc) inline private reexports by default. That will save us a lot of `clean`ing for external items and for html pages generation.

r? ghost
@rust-bors
rust-bors Bot merged commit a935ff8 into rust-lang:main Oct 31, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 31, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (9c3416d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 4
Improvements ✅
(primary)
-1.1% [-5.1%, -0.1%] 7
Improvements ✅
(secondary)
-30.8% [-59.8%, -1.7%] 2
All ❌✅ (primary) -1.1% [-5.1%, -0.1%] 7

Max RSS (memory usage)

Results (secondary -3.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.9% [1.9%, 1.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.5% [-8.5%, -8.5%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.8%, secondary -55.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.8% [-3.8%, -3.8%] 1
Improvements ✅
(secondary)
-55.0% [-55.0%, -55.0%] 1
All ❌✅ (primary) -3.8% [-3.8%, -3.8%] 1

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 406.61 MiB -> 406.77 MiB (0.04%)

@rustbot rustbot added the perf-regression Performance regression. label Oct 31, 2026
@GuillaumeGomez
GuillaumeGomez deleted the rustdoc-doc-private-perf branch November 1, 2026 20:38
eduardorittner pushed a commit to eduardorittner/miri that referenced this pull request Nov 2, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#164851 (Add behavior tests for `Arc` and `Rc`)
 - rust-lang/rust#164989 (rustdoc: Fix performance regression for private documented items)
 - rust-lang/rust#165079 (Remove GenericArgRef)
 - rust-lang/rust#161781 (Don't emit InlineAsm terminator if input operand is `!`.)
 - rust-lang/rust#162754 (optimize large elements for slice rotating)
 - rust-lang/rust#163252 (Remove windows-targets dependency from the root workspace)
 - rust-lang/rust#163839 (Fix the floating point clobbers of RISC-V `clobber_abi`)
 - rust-lang/rust#165104 (Use getrandom instead of /scheme/rand on Redox OS)
 - rust-lang/rust#165132 (Implement `advance_back_by` on `Fuse`)
 - rust-lang/rust#165142 (Remove the unused generic Graphviz writer)
 - rust-lang/rust#165233 (Remove test-aarch64-apple-* jobs temporarily)
 - rust-lang/rust#163371 (Don't suggest replacing foreign format specifiers in `concat!` output)
 - rust-lang/rust#163802 (fix RegionEq direction in canonical query responses)
 - rust-lang/rust#163986 (omit unconditionally invoking crate level limits query)
 - rust-lang/rust#164920 (Point at prior token on `let` when expression is expected)
 - rust-lang/rust#164987 (use adt_async_drop_tys for nested ADTs in needs_async_drop)
 - rust-lang/rust#165061 (Use a fixed-length encoding for hash disambiguators in v0 symbols)
 - rust-lang/rust#165114 (use native interpreter impl for funnel shifts intrinsics)
 - rust-lang/rust#165119 (remove unnecessary fast path from borrowck)
 - rust-lang/rust#165122 (fix MaybeDangling validity logic for ZST at usize::MAX)
 - rust-lang/rust#165128 (Move `doc(keyword)` and `doc(attribute)` attributes checks from `rustc_passes` to `rustc_attr_parsing`)
 - rust-lang/rust#165129 (Fix ICE in prelude edition lint)

> [!WARNING]
> This rollup conflicts with pending auto build #165217 and may need to be recreated if the pending build succeeds.
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants