mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-20 23:04:46 -07:00
global: snapshot
This commit is contained in:
@@ -325,25 +325,33 @@ impl Computer {
|
||||
.compute(indexer, &self.indexes, &starting_indexes, exit)
|
||||
})?;
|
||||
|
||||
timed("Computed inputs", || {
|
||||
self.inputs.compute(
|
||||
indexer,
|
||||
&self.indexes,
|
||||
&self.blocks,
|
||||
&starting_indexes,
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
|
||||
timed("Computed scripts", || {
|
||||
self.scripts.compute(
|
||||
indexer,
|
||||
&self.outputs,
|
||||
&self.prices,
|
||||
&starting_indexes,
|
||||
exit,
|
||||
)
|
||||
})?;
|
||||
// inputs and scripts are independent — parallelize
|
||||
let (inputs_result, scripts_result) = rayon::join(
|
||||
|| {
|
||||
timed("Computed inputs", || {
|
||||
self.inputs.compute(
|
||||
indexer,
|
||||
&self.indexes,
|
||||
&self.blocks,
|
||||
&starting_indexes,
|
||||
exit,
|
||||
)
|
||||
})
|
||||
},
|
||||
|| {
|
||||
timed("Computed scripts", || {
|
||||
self.scripts.compute(
|
||||
indexer,
|
||||
&self.outputs,
|
||||
&self.prices,
|
||||
&starting_indexes,
|
||||
exit,
|
||||
)
|
||||
})
|
||||
},
|
||||
);
|
||||
inputs_result?;
|
||||
scripts_result?;
|
||||
|
||||
timed("Computed outputs", || {
|
||||
self.outputs.compute(
|
||||
|
||||
Reference in New Issue
Block a user