Skip to content

Commit

Permalink
removing unnecessary baching for account updates
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Nov 5, 2024
1 parent 752bd7d commit bf146bf
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions bin/autobahn-router/src/edge_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,19 @@ pub fn spawn_updater_job(
if !updater.invalidate_one(res) {
break 'drain_loop;
}

let mut batchsize: u32 = 0;
let started_at = Instant::now();
'batch_loop: while let Ok(res) = account_updates.try_recv() {
batchsize += 1;
if !updater.invalidate_one(Ok(res)) {
break 'drain_loop;
}

// budget for microbatch
if batchsize > 10 || started_at.elapsed() > Duration::from_micros(500) {
break 'batch_loop;
}
}
// let mut batchsize: u32 = 0;
// let started_at = Instant::now();
// 'batch_loop: while let Ok(res) = account_updates.try_recv() {
// batchsize += 1;
// if !updater.invalidate_one(Ok(res)) {
// break 'drain_loop;
// }

// // budget for microbatch
// if batchsize > 10 || started_at.elapsed() > Duration::from_micros(500) {
// break 'batch_loop;
// }
// }
},
Ok(price_upd) = price_updates.recv() => {
if let Some(impacted_edges) = updater.state.edges_per_mint.get(&price_upd.mint) {
Expand Down

0 comments on commit bf146bf

Please sign in to comment.