Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vortex-file/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ impl CoalescedSegmentRequest {
}

/// Launch the request, reading the byte range from the provided reader.
pub async fn launch<R: VortexReadAt>(self, read: &R) {
pub async fn launch<R: VortexReadAt>(self, read: R) {
let alignment = self.segment_map[*self.requests[0].id() as usize].alignment;
let byte_range = self.byte_range.clone();
let buffer = read
Expand Down
11 changes: 9 additions & 2 deletions vortex-file/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,21 @@ impl VortexOpenOptions<GenericVortexFile> {

// Spawn an I/O driver onto the dispatcher.
let io_concurrency = self.options.io_concurrency;
let io_dispatcher = self.options.io_dispatcher.clone();
self.options
.io_dispatcher
.dispatch(move || {
async move {
// Drive the segment event stream.
let stream = driver
.map(|coalesced_req| coalesced_req.launch(&read))
.buffer_unordered(io_concurrency);
.map(|coalesced_req| {
let read = read.clone();
io_dispatcher
.dispatch(move || coalesced_req.launch(read))
.vortex_expect("Failed to dispatch I/O request")
})
.buffer_unordered(io_concurrency)
.map(|result| result.vortex_expect("infallible"));
pin_mut!(stream);

// Drive the stream to completion.
Expand Down
4 changes: 2 additions & 2 deletions vortex-io/src/dispatcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ impl IoDispatcher {
if #[cfg(target_arch = "wasm32")] {
Self(Arc::new(Inner::Wasm(WasmDispatcher::new())))
} else if #[cfg(not(feature = "compio"))] {
Self(Arc::new(Inner::Tokio(TokioDispatcher::new(1))))
Self(Arc::new(Inner::Tokio(TokioDispatcher::new(4))))
} else {
Self(Arc::new(Inner::Compio(CompioDispatcher::new(1))))
Self(Arc::new(Inner::Compio(CompioDispatcher::new(4))))
}
}
}
Expand Down
Loading