Enable customization of Tokio runtimes in diskann-benchmark-core#809
Open
hildebrandmw wants to merge 1 commit intomainfrom
Open
Enable customization of Tokio runtimes in diskann-benchmark-core#809hildebrandmw wants to merge 1 commit intomainfrom
diskann-benchmark-core#809hildebrandmw wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds public extension points so consumers of diskann-benchmark-core can customize Tokio runtime creation (e.g., opt-in Builder::enable_time) without changing the default runtime configuration used by the crate.
Changes:
- Add
diskann_benchmark_core::tokio::runtime_withto allow caller customization of a preconfigured multi-thread runtimeBuilder. - Add
diskann_benchmark_core::search::search_all_withto apply a caller-provided builder callback to each runtime created duringsearch_all. - Extend/adjust tests and docs to cover the new APIs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| diskann-benchmark-core/src/tokio.rs | Introduces runtime_with and adds tests validating customization and worker count. |
| diskann-benchmark-core/src/search/api.rs | Adds search_all_with, routes search_all through it, and extends tests/docs accordingly. |
Comments suppressed due to low confidence (1)
diskann-benchmark-core/src/tokio.rs:28
runtime_withduplicates the base builder setup currently done inruntime(). To avoid the two functions drifting if the default runtime configuration changes in the future, consider implementingruntime()in terms ofruntime_with(num_threads, |_| {})(or factoring out a shared helper that returns the preconfiguredBuilder).
pub fn runtime_with<F>(num_threads: usize, f: F) -> anyhow::Result<tokio::runtime::Runtime>
where
F: FnOnce(&mut tokio::runtime::Builder),
{
let mut builder = tokio::runtime::Builder::new_multi_thread();
builder.worker_threads(num_threads);
f(&mut builder);
Ok(builder.build()?)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #809 +/- ##
=======================================
Coverage 89.45% 89.46%
=======================================
Files 432 432
Lines 79452 79514 +62
=======================================
+ Hits 71075 71136 +61
- Misses 8377 8378 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
harsha-simhadri
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable caller customization of the runtimes built with two new methods:
diskann_benchmark_core::tokio::runtime_with: Construct a new runtime allowing the caller to customize the builder before creation.diskann_benchmark_core::search::search_all_with: Allow the caller to customize each runtime that gets created during the bulk search operation.Downstream work has revealed the need to enable timing in the tokio runtimes. Instead of forcing all consumers of
diskann-benchmark-coreto opt-in to timing, this PR allows callers to opt-in selectively.