Skip to content

Conversation

yotamofek
Copy link
Contributor

@yotamofek yotamofek commented Oct 6, 2025

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 6, 2025
entry_data: Option<EntryData>,
desc: String,
function_data: Option<FunctionData>,
function_data: Option<IndexItemFunctionType>,
Copy link
Contributor Author

@yotamofek yotamofek Oct 6, 2025

Choose a reason for hiding this comment

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

this is the (hopefully) impactful part: FunctionData is an OTW representation of IndexItemFunctionType, and there's no need to do the writing and parsing part until we leave the boundaries of the current process invocation

@yotamofek
Copy link
Contributor Author

first commit is just a cleanup (IMHO, probably a matter of taste): 15c5e34

@GuillaumeGomez
Copy link
Member

cc @notriddle as well.

Starting perf check. :)

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 6, 2025
…ay, r=<try>

[PERF] [rustdoc] Try to speed up search index building
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 6, 2025

☀️ Try build successful (CI)
Build commit: 53439ce (53439ceb215dbeebc67ba002601a21921d427a98, parent: d2acb427e424fd7d52377698046a06109e9777b4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53439ce): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@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
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 5
Improvements ✅
(secondary)
-0.9% [-1.0%, -0.8%] 6
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 5

Max RSS (memory usage)

Results (primary -0.5%, 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)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
2.0% [2.0%, 2.0%] 1
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) -0.5% [-2.3%, 1.4%] 2

Cycles

Results (secondary -2.6%)

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)
-2.6% [-3.2%, -2.1%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 470.924s -> 473.064s (0.45%)
Artifact size: 388.38 MiB -> 388.26 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2025
@yotamofek yotamofek force-pushed the wip/rustdoc/search_index/impl-display branch from 5ea7e13 to 3407d8b Compare October 6, 2025 19:52
@yotamofek
Copy link
Contributor Author

Results are nice, but let's see what they're like without 15c5e34

@Kobzol
Copy link
Member

Kobzol commented Oct 6, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 6, 2025
…ay, r=<try>

[PERF] [rustdoc] Try to speed up search index building
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 6, 2025

☀️ Try build successful (CI)
Build commit: de083db (de083db8b35606b62490c466c69b933dfde842ea, parent: 3d8c1c1fc077d04658de63261d8ce2903546db13)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (de083db): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@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
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 7
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.1%] 2
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 7

Max RSS (memory usage)

Results (primary 1.5%, secondary 1.9%)

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

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

Cycles

Results (secondary -2.2%)

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)
-2.2% [-2.3%, -2.1%] 2
All ❌✅ (primary) - - 0

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: 472.01s -> 472.099s (0.02%)
Artifact size: 388.39 MiB -> 388.32 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 7, 2025
@GuillaumeGomez
Copy link
Member

Not as much as I would have hoped but still visible positive impact, so looks good to me. :)

@yotamofek yotamofek force-pushed the wip/rustdoc/search_index/impl-display branch from 3407d8b to c5ab530 Compare October 7, 2025 10:40
@yotamofek
Copy link
Contributor Author

yotamofek commented Oct 7, 2025

@GuillaumeGomez thanks!

Added two commits.

First one (978ab7c) is to make the manual serde impls for IndexItemFunctionType nicer and maybe a little more performant, due to:

  1. when serializing, using Symbol::as_str instead of Symbol::to_string avoids an additional allocation per param name;
  2. when deserializing, do the conversion from String to Symbol iteratively, instead of collecting into an intermediate Vec<String> first

Second one (c5ab530) moves those serde impls out into a separate module. render/mod.rs is already huge as it is, I'd rather not make it bigger. It does make the serde impls less discoverable though, so that's the downside.

Let me know what you think and I'll squash and rewrite the commit message with whatever changes we end up keeping.

@yotamofek yotamofek changed the title [PERF] [rustdoc] Try to speed up search index building [rustdoc] Don't serialize & deserialize data that doesn't go OTW Oct 7, 2025
@yotamofek yotamofek marked this pull request as ready for review October 7, 2025 11:01
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 7, 2025

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

@GuillaumeGomez
Copy link
Member

I think it's fine as is, thanks! r=me once CI pass.

@bors rollup=maybe
@bors delegate+

@bors
Copy link
Collaborator

bors commented Oct 7, 2025

✌️ @yotamofek, you can now approve this pull request!

If @GuillaumeGomez told you to "r=me" after making some further change, please make that change, then do @bors r=@GuillaumeGomez

@yotamofek
Copy link
Contributor Author

@bors r=@GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Oct 7, 2025

📌 Commit c5ab530 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 Oct 7, 2025
@GuillaumeGomez
Copy link
Member

Hum, my rollup instruction was ignored apparently. Let's try again.

@bors rollup=maybe

bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 7 pull requests

Successful merges:

 - #145943 (stdlib docs: document lifetime extension for `format_args!`'s arguments)
 - #147243 (cmse: disallow `impl Trait` in `cmse-nonsecure-entry` return types)
 - #147402 ([rustdoc] Don't serialize & deserialize data that doesn't go OTW)
 - #147418 (Fix target list of `link_section`)
 - #147429 (Print tip for human error format in runtest)
 - #147441 (Fix comments error for Provenance impls)
 - #147442 (c-variadic: fix thir-print for `...` without a pattern)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4461dd9 into rust-lang:master Oct 7, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 7, 2025
rust-timer added a commit that referenced this pull request Oct 7, 2025
Rollup merge of #147402 - yotamofek:wip/rustdoc/search_index/impl-display, r=GuillaumeGomez

[rustdoc] Don't serialize & deserialize data that doesn't go OTW

`@GuillaumeGomez`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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.

6 participants