global: speed improvement part2

This commit is contained in:
nym21
2026-04-09 14:02:26 +02:00
parent 21a0226a19
commit 5a3e1b4e6e
24 changed files with 137 additions and 160 deletions

View File

@@ -1,7 +1,6 @@
use brk_error::Result;
use brk_indexer::Indexer;
use brk_types::{StoredBool, TxIndex, Version};
use vecdb::{Database, LazyVecFrom2, ReadableCloneableVec};
use brk_types::Version;
use vecdb::Database;
use super::Vecs;
use crate::{
@@ -13,25 +12,11 @@ impl Vecs {
pub(crate) fn forced_import(
db: &Database,
version: Version,
indexer: &Indexer,
indexes: &indexes::Vecs,
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
let tx_index_to_is_coinbase = LazyVecFrom2::init(
"is_coinbase",
version,
indexer.vecs.transactions.height.read_only_boxed_clone(),
indexer
.vecs
.transactions
.first_tx_index
.read_only_boxed_clone(),
|index: TxIndex, _height, first_tx_index| StoredBool::from(index == first_tx_index),
);
Ok(Self {
total: PerBlockFull::forced_import(db, "tx_count", version, indexes, cached_starts)?,
is_coinbase: tx_index_to_is_coinbase,
})
}
}