mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
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:
parent
d347ef996e
commit
6219c56138
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue