Skip to content

Commit

Permalink
Auto merge of rust-lang#120093 - adamreichold:rustc-hash-small-string…
Browse files Browse the repository at this point in the history
…s, r=<try>

[DO NOT MERGE] perf: test rustc-hash variant optimized for small strings.

I would be glad if a perf run could be performed for the modification proposed in rust-lang/rustc-hash#30 which came out of FNV beating fxhash for small strings when used in Tantivy. (Note that this is not changing the structure of rustc-hash, it just tries to optimize the implementation for handling the remaining bytes below the word size which appears to dominate performance for short strings.)
  • Loading branch information
bors committed Jan 18, 2024
2 parents 8424f8e + 120f4b2 commit 376db7f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
21 changes: 13 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ dependencies = [
"fluent-syntax",
"intl-memoizer",
"intl_pluralrules",
"rustc-hash",
"rustc-hash 1.1.0",
"self_cell 0.10.3",
"smallvec",
"unic-langid",
Expand Down Expand Up @@ -2118,7 +2118,7 @@ dependencies = [
"anyhow",
"clap",
"fs-err",
"rustc-hash",
"rustc-hash 1.1.0",
"rustdoc-json-types",
"serde",
"serde_json",
Expand Down Expand Up @@ -2374,7 +2374,7 @@ dependencies = [
"memmap2",
"parking_lot",
"perf-event-open-sys",
"rustc-hash",
"rustc-hash 1.1.0",
"smallvec",
]

Expand Down Expand Up @@ -2942,7 +2942,7 @@ checksum = "c4e8e505342045d397d0b6674dcb82d6faf5cf40484d30eeb88fc82ef14e903f"
dependencies = [
"datafrog",
"log",
"rustc-hash",
"rustc-hash 1.1.0",
]

[[package]]
Expand Down Expand Up @@ -3315,6 +3315,11 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc-hash"
version = "2.0.0"
source = "git+https://github.com/adamreichold/rustc-hash.git?branch=small-strings#6f0afc1216c5a6e67f0829facf466839ab7d845a"

[[package]]
name = "rustc-main"
version = "0.0.0"
Expand Down Expand Up @@ -3675,7 +3680,7 @@ dependencies = [
"memmap2",
"parking_lot",
"portable-atomic",
"rustc-hash",
"rustc-hash 2.0.0",
"rustc-rayon",
"rustc-rayon-core",
"rustc_arena",
Expand Down Expand Up @@ -4355,7 +4360,7 @@ name = "rustc_pattern_analysis"
version = "0.0.0"
dependencies = [
"derivative",
"rustc-hash",
"rustc-hash 2.0.0",
"rustc_apfloat",
"rustc_arena",
"rustc_data_structures",
Expand Down Expand Up @@ -4710,7 +4715,7 @@ name = "rustdoc-json-types"
version = "0.1.0"
dependencies = [
"bincode",
"rustc-hash",
"rustc-hash 1.1.0",
"serde",
"serde_json",
]
Expand Down Expand Up @@ -5705,7 +5710,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46"
dependencies = [
"rustc-hash",
"rustc-hash 1.1.0",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ itertools = "0.11"
jobserver_crate = { version = "0.1.27", package = "jobserver" }
libc = "0.2"
measureme = "11"
rustc-hash = "1.1.0"
rustc-hash = { git = "https://github.com/adamreichold/rustc-hash.git", branch = "small-strings" }
rustc-rayon = { version = "0.5.0", optional = true }
rustc-rayon-core = { version = "0.5.0", optional = true }
rustc_arena = { path = "../rustc_arena" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_pattern_analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
derivative = "2.2.0"
rustc-hash = "1.1.0"
rustc-hash = { git = "https://github.com/adamreichold/rustc-hash.git", branch = "small-strings" }
rustc_apfloat = "0.2.0"
rustc_arena = { path = "../rustc_arena", optional = true }
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
Expand Down
5 changes: 4 additions & 1 deletion src/tools/tidy/src/extdeps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use std::fs;
use std::path::Path;

/// List of allowed sources for packages.
const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crates.io-index\""];
const ALLOWED_SOURCES: &[&str] = &[
"\"registry+https://github.com/rust-lang/crates.io-index\"",
"\"git+https://github.com/adamreichold/rustc-hash.git?branch=small-strings#6f0afc1216c5a6e67f0829facf466839ab7d845a\"",
];

/// Checks for external package sources. `root` is the path to the directory that contains the
/// workspace `Cargo.toml`.
Expand Down

0 comments on commit 376db7f

Please sign in to comment.