From ed8b02d83e74074f300b1958df942c1bba84008f Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sun, 14 Sep 2025 10:05:07 +0300 Subject: [PATCH] perf/throughput/turso: Don't use spawn_blocking() Let's just use normal spawn() --- perf/throughput/turso/src/main.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/perf/throughput/turso/src/main.rs b/perf/throughput/turso/src/main.rs index 70ac525c0..bab2d7a47 100644 --- a/perf/throughput/turso/src/main.rs +++ b/perf/throughput/turso/src/main.rs @@ -2,7 +2,6 @@ use clap::{Parser, ValueEnum}; use std::sync::{Arc, Barrier}; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::Instant; -use tokio::runtime::Runtime; use turso::{Builder, Database, Result}; #[derive(Debug, Clone, Copy, ValueEnum)] @@ -65,18 +64,15 @@ async fn main() -> Result<()> { let db_clone = db.clone(); let barrier = Arc::clone(&start_barrier); - let handle = tokio::task::spawn_blocking(move || { - let rt = Runtime::new().unwrap(); - rt.block_on(worker_thread( - thread_id, - db_clone, - args.batch_size, - args.iterations, - barrier, - args.mode, - args.think, - )) - }); + let handle = tokio::task::spawn(worker_thread( + thread_id, + db_clone, + args.batch_size, + args.iterations, + barrier, + args.mode, + args.think, + )); handles.push(handle); }