Skip to content

Conversation

aDotInTheVoid
Copy link
Member

@aDotInTheVoid aDotInTheVoid commented Aug 15, 2024

Alternative to #110051 and #127456.

This lets us avoid rehashing the json index after building it by using the same hashmap type in construction and in rustdoc_json_types. The above PR's tried to do this by having rustdoc_json_types get the same hashmap that rustdoc has via rustc_data_structures. However, this can be made simpler if we change rustdoc instead.

For the rustdoc-type republish on crates.io, It will filter out the pub use, and not change source at all. rust-lang/rustdoc-types#30. That code already replaces the hashmap to use the one in std::collections (instead of FxHashMap)

try-job: dist-arm-linux

r? @GuillaumeGomez

@aDotInTheVoid
Copy link
Member Author

@bors try

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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 Aug 15, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2024

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
rustdoc-json: Use FxHashMap from rustdoc_json_types

Alternative to rust-lang#110051 and rust-lang#127456.

This lets us avoid rehashing the json index after building it by using the same hashmap type in construction and in rustdoc_json_types. The above PR's tried to do this by having rustdoc_json_types get the same hashmap that rustdoc has via rustc_data_structures. However, this can be made simpler if we change rustdoc instead.

For the rustdoc-type republish on crates.io, I'll filter out the `pub use`, and not change the API at all. That code [already replaces the hashmap](https://github.com/aDotInTheVoid/rustdoc-types/blob/8d6528669ec64c2af43d1c79a228b7711cefdad7/update.sh#L11) to use the one in `std::collections` (instead of `FxHashMap`)

try-job: dist-arm-linux

r? `@GuillaumeGomez`
@bors
Copy link
Collaborator

bors commented Aug 15, 2024

⌛ Trying commit 9028b53 with merge 4cbfcbf...

@GuillaumeGomez
Copy link
Member

Thanks!

r=me once CI pass

@obi1kenobi
Copy link
Member

Oh very nice, I bet this will have a measurable perf impact on large crates! 🙌

@bors
Copy link
Collaborator

bors commented Aug 15, 2024

☀️ Try build successful - checks-actions
Build commit: 4cbfcbf (4cbfcbfce493a9dc64956c155d730b6ec2fb4e57)

@aDotInTheVoid
Copy link
Member Author

@bors r=GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Aug 15, 2024

📌 Commit 9028b53 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 15, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 15, 2024
…llaumeGomez

rustdoc-json: Use FxHashMap from rustdoc_json_types

Alternative to rust-lang#110051 and rust-lang#127456.

This lets us avoid rehashing the json index after building it by using the same hashmap type in construction and in rustdoc_json_types. The above PR's tried to do this by having rustdoc_json_types get the same hashmap that rustdoc has via rustc_data_structures. However, this can be made simpler if we change rustdoc instead.

For the rustdoc-type republish on crates.io, It will filter out the `pub use`, and not change source at all. rust-lang/rustdoc-types#30. That code [already replaces the hashmap](https://github.com/aDotInTheVoid/rustdoc-types/blob/8d6528669ec64c2af43d1c79a228b7711cefdad7/update.sh#L11) to use the one in `std::collections` (instead of `FxHashMap`)

try-job: dist-arm-linux

r? `@GuillaumeGomez`
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128348 (Unconditionally allow shadow call-stack sanitizer for AArch64)
 - rust-lang#128922 (rust-analyzer: use in-tree `pattern_analysis` crate)
 - rust-lang#128935 (More work on `zstd` compression)
 - rust-lang#129072 (Infer async closure args from `Fn` bound even if there is no corresponding `Future` bound on return)
 - rust-lang#129101 (Fix projections when parent capture is by-ref but child capture is by-value in the `ByMoveBody` pass)
 - rust-lang#129106 (Remove redundant type ops: `Eq`/`Subtype`)
 - rust-lang#129122 (Remove duplicated `Rustdoc::output` method from `run-make-support` lib)
 - rust-lang#129124 (rustdoc-json: Use FxHashMap from rustdoc_json_types)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128348 (Unconditionally allow shadow call-stack sanitizer for AArch64)
 - rust-lang#129065 (Use `impl PartialEq<TokenKind> for Token` more.)
 - rust-lang#129072 (Infer async closure args from `Fn` bound even if there is no corresponding `Future` bound on return)
 - rust-lang#129096 (Print more verbose error for commands that capture output)
 - rust-lang#129101 (Fix projections when parent capture is by-ref but child capture is by-value in the `ByMoveBody` pass)
 - rust-lang#129106 (Remove redundant type ops: `Eq`/`Subtype`)
 - rust-lang#129122 (Remove duplicated `Rustdoc::output` method from `run-make-support` lib)
 - rust-lang#129124 (rustdoc-json: Use FxHashMap from rustdoc_json_types)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ef72a6a into rust-lang:master Aug 15, 2024
7 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
Rollup merge of rust-lang#129124 - aDotInTheVoid:rdj-hashmap-3, r=GuillaumeGomez

rustdoc-json: Use FxHashMap from rustdoc_json_types

Alternative to rust-lang#110051 and rust-lang#127456.

This lets us avoid rehashing the json index after building it by using the same hashmap type in construction and in rustdoc_json_types. The above PR's tried to do this by having rustdoc_json_types get the same hashmap that rustdoc has via rustc_data_structures. However, this can be made simpler if we change rustdoc instead.

For the rustdoc-type republish on crates.io, It will filter out the `pub use`, and not change source at all. rust-lang/rustdoc-types#30. That code [already replaces the hashmap](https://github.com/aDotInTheVoid/rustdoc-types/blob/8d6528669ec64c2af43d1c79a228b7711cefdad7/update.sh#L11) to use the one in `std::collections` (instead of `FxHashMap`)

try-job: dist-arm-linux

r? ``@GuillaumeGomez``
@rustbot rustbot added this to the 1.82.0 milestone Aug 15, 2024
@workingjubilee
Copy link
Member

homu, chill. @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 16, 2024
@aDotInTheVoid aDotInTheVoid added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 16, 2024
@aDotInTheVoid aDotInTheVoid deleted the rdj-hashmap-3 branch August 16, 2024 14:34
aDotInTheVoid added a commit to rust-lang/rustdoc-types that referenced this pull request Aug 17, 2024
@aDotInTheVoid aDotInTheVoid mentioned this pull request Mar 8, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend merged-by-bors This PR was explicitly merged by bors. 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.

6 participants