BlockFileLoaderBitcoindTest: add test streamEntireBitcoindBlockchainAsBlocks()

This test is useful for performance comparisons with
`streamEntireBitcoindBlockchainAsBuffers()`.

With adding to the `TxConfidenceTable` removed from `Block.read()` and
on a fast, modern laptop, `streamEntireBitcoindBlockchainAsBuffers()`
currently takes under 2 minutes while `streamEntireBitcoindBlockchainAsBlocks()`
takes over 5 minutes.
This commit is contained in:
Sean Gilligan 2023-10-04 18:34:13 -07:00 committed by Andreas Schildbach
parent d347ef996e
commit 6219c56138

View file

@ -94,4 +94,12 @@ public class BlockFileLoaderBitcoindTest {
assertTrue(blockCount > 1); assertTrue(blockCount > 1);
} }
@Test
public void streamEntireBitcoindBlockchainAsBlocks() {
BlockFileLoader loader = new BlockFileLoader(BitcoinNetwork.MAINNET, BlockFileLoader.getReferenceClientBlockFileList());
long blockCount = loader.stream().count();
System.out.println("Final block height: " + (blockCount - 1));
assertTrue(blockCount > 1);
}
} }