Simpler tokio runtime (#140)

* Simpler tokio runtime; 3 threads and no io driver

* switch benches over to other runtime
This commit is contained in:
June
2026-03-05 15:54:55 -06:00
committed by GitHub
parent fca61d55b5
commit 725c6c6bfd
3 changed files with 20 additions and 6 deletions
+2
View File
@@ -1,6 +1,8 @@
# Unreleased # Unreleased
- Added windows support! (thank you to [@jarjk](https://github.com/jarjk) for helping out!)
- Added keybindings (`0`/`$`) to scroll to left or right side of zoomed-in image ([#131](https://github.com/itsjunetime/tdf/pull/131), thank you [@IshDeshpa](https://github.com/IshDeshpa)!) - Added keybindings (`0`/`$`) to scroll to left or right side of zoomed-in image ([#131](https://github.com/itsjunetime/tdf/pull/131), thank you [@IshDeshpa](https://github.com/IshDeshpa)!)
- (Internal) decreased runtime footprint of tokio runtime
# v0.5.0 # v0.5.0
+6 -1
View File
@@ -34,7 +34,12 @@ fn for_all_combos(
name: &'static str, name: &'static str,
mut f: impl FnMut(&Runtime, BenchmarkId, &'static str, ProtocolType) mut f: impl FnMut(&Runtime, BenchmarkId, &'static str, ProtocolType)
) { ) {
let rt = tokio::runtime::Runtime::new().unwrap(); let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(3)
.enable_time()
.build()
.unwrap();
for proto in PROTOS { for proto in PROTOS {
for file in FILES { for file in FILES {
f( f(
+9 -2
View File
@@ -70,11 +70,18 @@ fn reset_term() {
); );
} }
#[tokio::main] fn main() -> Result<(), WrappedErr> {
async fn main() -> Result<(), WrappedErr> { let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(3)
.enable_time()
.build()
.unwrap();
rt.block_on(async move {
let result = inner_main().await; let result = inner_main().await;
reset_term(); reset_term();
result result
})
} }
async fn inner_main() -> Result<(), WrappedErr> { async fn inner_main() -> Result<(), WrappedErr> {