Skip to content

Commit 6385f33

Browse files
committed
vortex-file: increase IO dispatch thread pool to num_cpus
It's currently set to 1, which causes an IO bottleneck. Signed-off-by: Alfonso Subiotto Marques <[email protected]>
1 parent 1fbc3a3 commit 6385f33

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

Cargo.lock

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ noodles-bgzf = "0.43.0"
130130
noodles-vcf = "0.81.0"
131131
num-traits = "0.2.19"
132132
num_enum = { version = "0.7.3", default-features = false }
133+
num_cpus = "1"
133134
object_store = { version = "0.12.3", default-features = false }
134135
once_cell = "1.21"
135136
opentelemetry = "0.30.0"

vortex-file/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ itertools = { workspace = true }
2525
linked_hash_set = { workspace = true }
2626
log = { workspace = true }
2727
moka = { workspace = true, features = ["future"] }
28+
num_cpus = { workspace = true }
2829
object_store = { workspace = true, optional = true }
2930
rustc-hash = { workspace = true }
3031
tokio = { workspace = true, features = ["rt"], optional = true }

vortex-file/src/generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::{EOF_SIZE, FileType, Footer, MAX_FOOTER_SIZE, VortexFile, VortexOpenO
2020

2121
#[cfg(feature = "tokio")]
2222
static TOKIO_DISPATCHER: std::sync::LazyLock<IoDispatcher> =
23-
std::sync::LazyLock::new(|| IoDispatcher::new_tokio(1));
23+
std::sync::LazyLock::new(|| IoDispatcher::new_tokio(num_cpus::get()));
2424

2525
/// A type of Vortex file that supports any [`VortexReadAt`] implementation.
2626
///

0 commit comments

Comments
 (0)