Skip to content

Commit

Permalink
Switch to rayon-core for faster build
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanshade committed Jun 18, 2024
1 parent c8834c2 commit bc6cde8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std = []
# `update_rayon` and (in combination with `mmap` below) `update_mmap_rayon`
# methods, for multithreaded hashing. However, even if this feature is enabled,
# all other APIs remain single-threaded.
rayon = ["dep:rayon", "std"]
rayon = ["dep:rayon-core", "std"]

# The `mmap` feature (disabled by default, but enabled for docs.rs) adds the
# `update_mmap` and (in combination with `rayon` above) `update_mmap_rayon`
Expand Down Expand Up @@ -98,7 +98,7 @@ constant_time_eq = "0.3.0"
cfg-if = "1.0.0"
digest = { version = "0.10.1", features = [ "mac" ], optional = true }
memmap2 = { version = "0.9", optional = true }
rayon = { version = "1.2.1", optional = true }
rayon-core = { version = "1.12.1", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
zeroize = { version = "1", default-features = false, features = ["zeroize_derive"], optional = true }

Expand Down
20 changes: 2 additions & 18 deletions b3sum/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion b3sum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ anyhow = "1.0.25"
blake3 = { version = "1", path = "..", features = ["mmap", "rayon"] }
clap = { version = "4.0.8", features = ["derive", "wrap_help"] }
hex = "0.4.0"
rayon = "1.2.1"
rayon-core = "1.12.1"
wild = "2.0.3"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion b3sum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ fn check_one_checkfile(path: &Path, args: &Args, files_failed: &mut u64) -> Resu

fn main() -> Result<()> {
let args = Args::parse()?;
let mut thread_pool_builder = rayon::ThreadPoolBuilder::new();
let mut thread_pool_builder = rayon_core::ThreadPoolBuilder::new();
if let Some(num_threads) = args.num_threads() {
thread_pool_builder = thread_pool_builder.num_threads(num_threads);
}
Expand Down
2 changes: 1 addition & 1 deletion src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Join for RayonJoin {
RA: Send,
RB: Send,
{
rayon::join(oper_a, oper_b)
rayon_core::join(oper_a, oper_b)
}
}

Expand Down

0 comments on commit bc6cde8

Please sign in to comment.