Skip to content

Commit

Permalink
Revert: deserialize stored transactions in a rayon thread
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Aug 23, 2022
1 parent 5b3422c commit 487df16
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions zebra-state/src/service/finalized_state/disk_format/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,10 @@ impl FromDisk for Transaction {
fn from_bytes(bytes: impl AsRef<[u8]>) -> Self {
let bytes = bytes.as_ref();

let mut tx = None;

// # Performance
//
// Move CPU-intensive deserialization cryptography into the rayon thread pool.
// This avoids blocking the tokio executor.
rayon::in_place_scope_fifo(|scope| {
scope.spawn_fifo(|_scope| {
tx = Some(bytes.as_ref().zcash_deserialize_into().expect(
"deserialization format should match the serialization format used by IntoDisk",
));
});
});

tx.expect("scope has already run")
bytes
.as_ref()
.zcash_deserialize_into()
.expect("deserialization format should match the serialization format used by IntoDisk")
}
}

Expand Down

0 comments on commit 487df16

Please sign in to comment.