mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
* update the fast FullBlock parser (that just skips fields) to support the new serialization of RewardChainBlock * add test and shard the test, to enable it running in parallel * disable expensive tests on MacOS Intel * document some aspects of the full_blocks_utils test
27 lines
580 B
Python
27 lines
580 B
Python
from __future__ import annotations
|
|
|
|
import random
|
|
from time import perf_counter
|
|
|
|
from chia._tests.util.test_full_block_utils import get_full_blocks
|
|
|
|
random.seed(123456789)
|
|
|
|
|
|
def main() -> None:
|
|
total_time = 0.0
|
|
counter = 0
|
|
for shard in [0, 1, 2, 3]:
|
|
for block in get_full_blocks(shard):
|
|
start = perf_counter()
|
|
block.to_json_dict()
|
|
end = perf_counter()
|
|
total_time += end - start
|
|
counter += 1
|
|
|
|
print(f"total time: {total_time:0.2f}s ({counter} iterations)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|