Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rustc-hash feature #42

Merged
merged 4 commits into from
Oct 20, 2024

Conversation

jalil-salame
Copy link
Contributor

@jalil-salame jalil-salame commented Oct 19, 2024

Changes in preparation of rust-lang/rust#131936 (must be merged after):

  • Introduce rustc-hash dependency and feature.
  • Modify the update.sh script accordingly.

Closes #35

Copy link
Member

@aDotInTheVoid aDotInTheVoid left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. The approach looks right.

Could you:

  1. Update the code with the script (by pointing at your repo for now) so we can check it looks correct
  2. Update the CI to test with the new feature included.

@@ -9,9 +9,7 @@ repo="rust"
branch="master"
Copy link
Member

Choose a reason for hiding this comment

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

You can use these user/repo/branch variables to point the update script at your fork/branch, so that you can include the new code in here, so it's easier to see the effect of the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

[features]
default = []

# Switch the hashmaps used in rustdoc-types to the FxHashMap from rustc-hash.
Copy link
Member

Choose a reason for hiding this comment

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

I think these documentation should go in either the README.md, or the crate-level doc comment (or both)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think all three! Because the docs.rs feature flags tab is a great place and should be used more c:

E.g. clap's

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, I'd need to do another PR to rust-lang/rust to modify the crate level doc comment.

In the mean time I modified the README to add more context

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. it'll need to be in rust-lang/rust, but I don't think it's worth blocking this PR on that being done.

Copy link
Member

@aDotInTheVoid aDotInTheVoid left a comment

Choose a reason for hiding this comment

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

Almost there, just needs tweaks to the README wording to be more useful to users.

[features]
default = []

# Switch the hashmaps used in rustdoc-types to the FxHashMap from rustc-hash.
Copy link
Member

Choose a reason for hiding this comment

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

Yeah. it'll need to be in rust-lang/rust, but I don't think it's worth blocking this PR on that being done.

README.md Outdated
`rustc-hash::FxHashMap` which improves performance when reading big JSON files
(like `aws_sdk_rs`'s).

We have tested this on `cargo-semver-checks` using `aws_sdk_ec2`'s JSON and
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the use of "We" here. I think it's important to have a clear line between what's maintained by the rust project, and what isn't.

Additionally I don't think the numbers presented here are particularly useful to people who don't know/care about csc internals. I think just a percentage improvement would much more useful.

In testing on [cargo-semver-checks](some link), this provided a whatever% perfomance improvement on the aws-sdk-ec2 crate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded, I hope this is better?

Changes in preparation of [rust-lang/rust#131936][1]:

- Introduce `rustc-hash` dependency and feature.
- Modify the `update.sh` script accordingly.

[1]: rust-lang/rust#131936
@aDotInTheVoid aDotInTheVoid merged commit 898a57d into rust-lang:trunk Oct 20, 2024
2 checks passed
@jalil-salame jalil-salame deleted the rustdoc-types-rustc-hash branch October 20, 2024 16:16
jalil-salame added a commit to jalil-salame/rust that referenced this pull request Oct 20, 2024
The `rustc-hash` feature is publicly exposed by the `rustdoc-types`. It
is already documented in that crate's README and Cargo.toml, but we
might as well add some information to the crate docs themselves c:

Follow up to:
- rust-lang#131936
- [rust-lang/rustdoc-types#42][1]

[1]: rust-lang/rustdoc-types#42
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 20, 2024
…t-feature, r=aDotInTheVoid

fix(rustdoc-json-types): document rustc-hash feature

The `rustc-hash` feature is publicly exposed by the `rustdoc-types`. It is already documented in that crate's README and Cargo.toml, but we might as well add some information to the crate docs themselves c:

Follow up to:
- rust-lang#131936
- [rust-lang/rustdoc-types#42][1]

[1]: rust-lang/rustdoc-types#42

r? `@aDotInTheVoid`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2024
Rollup merge of rust-lang#131973 - jalil-salame:rustdoc-types-document-feature, r=aDotInTheVoid

fix(rustdoc-json-types): document rustc-hash feature

The `rustc-hash` feature is publicly exposed by the `rustdoc-types`. It is already documented in that crate's README and Cargo.toml, but we might as well add some information to the crate docs themselves c:

Follow up to:
- rust-lang#131936
- [rust-lang/rustdoc-types#42][1]

[1]: rust-lang/rustdoc-types#42

r? `@aDotInTheVoid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use cfg's for difference between librustdoc and crates.io version
2 participants