From be91202d6b4338e8dc61cc9e502444405bde5796 Mon Sep 17 00:00:00 2001 From: Ludo Galabru Date: Tue, 1 Aug 2023 08:44:13 +0200 Subject: [PATCH] feat: attempt to scale up multithreading --- components/hord-cli/src/hord/mod.rs | 6 ++++-- components/hord-cli/src/service/mod.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/hord-cli/src/hord/mod.rs b/components/hord-cli/src/hord/mod.rs index 9b7159bd..e5fb0dbc 100644 --- a/components/hord-cli/src/hord/mod.rs +++ b/components/hord-cli/src/hord/mod.rs @@ -1190,10 +1190,12 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3( let expected_traversals = transactions_ids.len() + l1_cache_hits.len(); let (traversal_tx, traversal_rx) = channel(); - let traversal_data_pool = ThreadPool::new(hord_config.ingestion_thread_max); + let thread_max = hord_config.ingestion_thread_max * 3; + + let traversal_data_pool = ThreadPool::new(thread_max); let mut tx_thread_pool = vec![]; - for thread_index in 0..hord_config.ingestion_thread_max { + for thread_index in 0..thread_max { let (tx, rx) = channel(); tx_thread_pool.push(tx); diff --git a/components/hord-cli/src/service/mod.rs b/components/hord-cli/src/service/mod.rs index 68aa80fb..7084af7d 100644 --- a/components/hord-cli/src/service/mod.rs +++ b/components/hord-cli/src/service/mod.rs @@ -126,7 +126,7 @@ impl Service { while let Some((start_block, end_block)) = should_sync_hord_db(&self.config, &self.ctx)? { - let end_block = end_block.min(start_block + 512); + let end_block = end_block.min(start_block + 256); info!( self.ctx.expect_logger(), "Indexing inscriptions from block #{start_block} to block #{end_block}"