mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-19 06:58:11 -07:00
benches: added
This commit is contained in:
@@ -9,7 +9,7 @@ use brk_types::{
|
||||
use log::error;
|
||||
use rayon::prelude::*;
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use vecdb::{AnyVec, GenericStoredVec, TypedVecIterator};
|
||||
use vecdb::{AnyVec, GenericStoredVec, TypedVecIterator, likely};
|
||||
|
||||
use crate::{Indexes, Readers, Stores, Vecs, constants::*};
|
||||
|
||||
@@ -628,7 +628,7 @@ impl<'a> BlockProcessor<'a> {
|
||||
|
||||
/// Check for TXID collisions (only for known duplicate TXIDs).
|
||||
pub fn check_txid_collisions(&self, txs: &[ComputedTx]) -> Result<()> {
|
||||
if !self.check_collisions {
|
||||
if likely(!self.check_collisions) {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ impl Vecs {
|
||||
|
||||
pub fn flush(&mut self, height: Height) -> Result<()> {
|
||||
self.iter_mut_any_stored_vec()
|
||||
// self.par_iter_mut_any_stored_vec()
|
||||
.par_bridge()
|
||||
.try_for_each(|vec| vec.stamped_write(Stamp::from(height)))?;
|
||||
self.db.flush()?;
|
||||
@@ -161,6 +162,16 @@ impl Vecs {
|
||||
.chain(self.output.iter_mut_any())
|
||||
}
|
||||
|
||||
// fn par_iter_mut_any_stored_vec(&mut self) -> impl Iterator<Item = &mut dyn AnyStoredVec> {
|
||||
// self.block
|
||||
// .iter_mut_any()
|
||||
// .chain(self.tx.iter_mut_any())
|
||||
// .chain(self.txin.iter_mut_any())
|
||||
// .chain(self.txout.iter_mut_any())
|
||||
// .chain(self.address.iter_mut_any())
|
||||
// .chain(self.output.iter_mut_any())
|
||||
// }
|
||||
|
||||
pub fn db(&self) -> &Database {
|
||||
&self.db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user