Skip to content

Commit

Permalink
feat: attempt to scale up multithreading
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Aug 1, 2023
1 parent ddb329c commit be91202
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions components/hord-cli/src/hord/mod.rs
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion components/hord-cli/src/service/mod.rs
Expand Up @@ -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}"
Expand Down

0 comments on commit be91202

Please sign in to comment.