mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-18 18:59:45 -07:00
benches: added
This commit is contained in:
@@ -31,7 +31,7 @@ serde = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
toml = "0.9.10"
|
||||
vecdb = { workspace = true }
|
||||
zip = { version = "6.0.0", default-features = false, features = ["deflate"] }
|
||||
zip = { version = "7.0.0", default-features = false, features = ["deflate"] }
|
||||
|
||||
[[bin]]
|
||||
name = "brk"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ derive_deref = { workspace = true }
|
||||
itoa = "1.0.15"
|
||||
jiff = { workspace = true }
|
||||
num_enum = "0.7.5"
|
||||
rapidhash = "4.1.1"
|
||||
ryu = "1.0.20"
|
||||
rapidhash = "4.2.0"
|
||||
ryu = "1.0.21"
|
||||
schemars = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
Reference in New Issue
Block a user