Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement merkleizeBlockArray #421

Merged
merged 3 commits into from
Nov 9, 2024
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Nov 6, 2024

Motivation

  • when we have a list of bytes or list of composite, if new value is over the cached chunk/block bytes, right now we reallocate the whole Uint8Array which is not good for gc

Description

  • Instead of that, implement merkleizeBlockArray(blocks: Uint8Array[], ...). In the above case we only need to allocate some more Uint8Array instances, each 64 bytes
  • refactor merkleizeInto():
    • rename merkleizeBlocksBytes() to avoid naming conflict
    • rename variables
  • model block bytes which is 64 bytes instead of chunk bytes which is 32 bytes (1 block = 2 chunks)
  • the consuming of this merkleizeBlockArray() method will come in the next PR

part of #378

@twoeths twoeths marked this pull request as ready for review November 6, 2024 08:03
@twoeths twoeths requested a review from a team as a code owner November 6, 2024 08:03
Copy link

github-actions bot commented Nov 6, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: bc451d9 Previous: cf3e1f0 Ratio
digestTwoHashObjects 50023 times 48.733 ms/op 47.711 ms/op 1.02
digest64 50023 times 55.402 ms/op 53.527 ms/op 1.04
digest 50023 times 59.437 ms/op 54.509 ms/op 1.09
input length 32 1.2150 us/op 1.2080 us/op 1.01
input length 64 1.3640 us/op 1.3330 us/op 1.02
input length 128 2.2760 us/op 2.3010 us/op 0.99
input length 256 3.3940 us/op 3.4310 us/op 0.99
input length 512 5.5480 us/op 5.6630 us/op 0.98
input length 1024 10.806 us/op 10.983 us/op 0.98
digest 1000000 times 876.34 ms/op 873.36 ms/op 1.00
hashObjectToByteArray 50023 times 1.7089 ms/op 1.4322 ms/op 1.19
byteArrayToHashObject 50023 times 2.3079 ms/op 2.4755 ms/op 0.93
digest64 200092 times 219.61 ms/op 218.28 ms/op 1.01
hash 200092 times using batchHash4UintArray64s 238.08 ms/op 237.10 ms/op 1.00
digest64HashObjects 200092 times 199.03 ms/op 194.39 ms/op 1.02
hash 200092 times using batchHash4HashObjectInputs 208.61 ms/op 200.14 ms/op 1.04
getGindicesAtDepth 4.2650 us/op 4.2930 us/op 0.99
iterateAtDepth 7.7780 us/op 7.7060 us/op 1.01
getGindexBits 486.00 ns/op 461.00 ns/op 1.05
gindexIterator 1.0580 us/op 1.0770 us/op 0.98
HashComputationLevel.push then loop 27.450 ms/op 25.300 ms/op 1.08
HashComputation[] push then loop 51.384 ms/op 48.617 ms/op 1.06
hash 2 Uint8Array 500000 times - as-sha256 555.61 ms/op 538.29 ms/op 1.03
hashTwoObjects 500000 times - as-sha256 505.60 ms/op 508.02 ms/op 1.00
executeHashComputations - as-sha256 47.694 ms/op 45.516 ms/op 1.05
hash 2 Uint8Array 500000 times - noble 1.2188 s/op 1.0725 s/op 1.14
hashTwoObjects 500000 times - noble 1.7164 s/op 1.5023 s/op 1.14
executeHashComputations - noble 43.383 ms/op 36.074 ms/op 1.20
hash 2 Uint8Array 500000 times - hashtree 229.86 ms/op 254.38 ms/op 0.90
hashTwoObjects 500000 times - hashtree 215.98 ms/op 285.98 ms/op 0.76
executeHashComputations - hashtree 11.714 ms/op 11.598 ms/op 1.01
getHashComputations 2.2456 ms/op 2.7371 ms/op 0.82
executeHashComputations 11.578 ms/op 11.964 ms/op 0.97
get root 18.176 ms/op 17.848 ms/op 1.02
getNodeH() x7812.5 avg hindex 12.575 us/op 12.154 us/op 1.03
getNodeH() x7812.5 index 0 6.2560 us/op 6.2600 us/op 1.00
getNodeH() x7812.5 index 7 6.2600 us/op 6.2270 us/op 1.01
getNodeH() x7812.5 index 7 with key array 6.2760 us/op 6.2540 us/op 1.00
new LeafNode() x7812.5 14.674 us/op 14.663 us/op 1.00
getHashComputations 250000 nodes 20.301 ms/op 19.524 ms/op 1.04
batchHash 250000 nodes 90.449 ms/op 85.990 ms/op 1.05
get root 250000 nodes 118.33 ms/op 119.77 ms/op 0.99
getHashComputations 500000 nodes 30.505 ms/op 26.630 ms/op 1.15
batchHash 500000 nodes 170.19 ms/op 153.23 ms/op 1.11
get root 500000 nodes 244.72 ms/op 243.45 ms/op 1.01
getHashComputations 1000000 nodes 74.804 ms/op 56.644 ms/op 1.32
batchHash 1000000 nodes 357.74 ms/op 326.79 ms/op 1.09
get root 1000000 nodes 464.72 ms/op 491.85 ms/op 0.94
multiproof - depth 15, 1 requested leaves 8.8010 us/op 8.5500 us/op 1.03
tree offset multiproof - depth 15, 1 requested leaves 19.263 us/op 18.626 us/op 1.03
compact multiproof - depth 15, 1 requested leaves 4.2300 us/op 3.5070 us/op 1.21
multiproof - depth 15, 2 requested leaves 14.010 us/op 12.237 us/op 1.14
tree offset multiproof - depth 15, 2 requested leaves 23.598 us/op 22.648 us/op 1.04
compact multiproof - depth 15, 2 requested leaves 3.9810 us/op 3.5100 us/op 1.13
multiproof - depth 15, 3 requested leaves 19.619 us/op 16.920 us/op 1.16
tree offset multiproof - depth 15, 3 requested leaves 31.455 us/op 28.126 us/op 1.12
compact multiproof - depth 15, 3 requested leaves 5.6460 us/op 4.2140 us/op 1.34
multiproof - depth 15, 4 requested leaves 25.199 us/op 23.081 us/op 1.09
tree offset multiproof - depth 15, 4 requested leaves 39.010 us/op 35.934 us/op 1.09
compact multiproof - depth 15, 4 requested leaves 6.4930 us/op 5.1210 us/op 1.27
packedRootsBytesToLeafNodes bytes 4000 offset 0 2.1770 us/op 2.0670 us/op 1.05
packedRootsBytesToLeafNodes bytes 4000 offset 1 2.1550 us/op 1.9540 us/op 1.10
packedRootsBytesToLeafNodes bytes 4000 offset 2 2.0910 us/op 1.9530 us/op 1.07
packedRootsBytesToLeafNodes bytes 4000 offset 3 2.1860 us/op 1.9540 us/op 1.12
subtreeFillToContents depth 40 count 250000 43.373 ms/op 44.977 ms/op 0.96
setRoot - gindexBitstring 10.016 ms/op 9.6980 ms/op 1.03
setRoot - gindex 10.822 ms/op 9.5255 ms/op 1.14
getRoot - gindexBitstring 3.1374 ms/op 2.5691 ms/op 1.22
getRoot - gindex 3.8210 ms/op 3.2999 ms/op 1.16
getHashObject then setHashObject 12.274 ms/op 9.6613 ms/op 1.27
setNodeWithFn 9.5870 ms/op 7.8990 ms/op 1.21
getNodeAtDepth depth 0 x100000 1.1149 ms/op 1.1146 ms/op 1.00
setNodeAtDepth depth 0 x100000 2.7993 ms/op 2.4467 ms/op 1.14
getNodesAtDepth depth 0 x100000 1.0522 ms/op 1.0529 ms/op 1.00
setNodesAtDepth depth 0 x100000 1.5228 ms/op 1.5160 ms/op 1.00
getNodeAtDepth depth 1 x100000 1.1792 ms/op 1.1842 ms/op 1.00
setNodeAtDepth depth 1 x100000 6.1975 ms/op 5.2486 ms/op 1.18
getNodesAtDepth depth 1 x100000 1.1764 ms/op 1.1809 ms/op 1.00
setNodesAtDepth depth 1 x100000 4.9712 ms/op 4.4512 ms/op 1.12
getNodeAtDepth depth 2 x100000 1.4572 ms/op 1.4532 ms/op 1.00
setNodeAtDepth depth 2 x100000 11.277 ms/op 12.918 ms/op 0.87
getNodesAtDepth depth 2 x100000 19.643 ms/op 18.310 ms/op 1.07
setNodesAtDepth depth 2 x100000 15.172 ms/op 13.076 ms/op 1.16
tree.getNodesAtDepth - gindexes 10.486 ms/op 7.5604 ms/op 1.39
tree.getNodesAtDepth - push all nodes 2.5014 ms/op 1.9187 ms/op 1.30
tree.getNodesAtDepth - navigation 234.50 us/op 233.69 us/op 1.00
tree.setNodesAtDepth - indexes 564.41 us/op 419.24 us/op 1.35
set at depth 8 577.00 ns/op 457.00 ns/op 1.26
set at depth 16 795.00 ns/op 594.00 ns/op 1.34
set at depth 32 1.2580 us/op 935.00 ns/op 1.35
iterateNodesAtDepth 8 256 15.920 us/op 13.176 us/op 1.21
getNodesAtDepth 8 256 3.8840 us/op 3.3530 us/op 1.16
iterateNodesAtDepth 16 65536 4.9339 ms/op 4.1844 ms/op 1.18
getNodesAtDepth 16 65536 2.1304 ms/op 1.5705 ms/op 1.36
iterateNodesAtDepth 32 250000 18.405 ms/op 15.211 ms/op 1.21
getNodesAtDepth 32 250000 4.3564 ms/op 4.3382 ms/op 1.00
iterateNodesAtDepth 40 250000 16.328 ms/op 15.110 ms/op 1.08
getNodesAtDepth 40 250000 4.4548 ms/op 4.3206 ms/op 1.03
250000 validators root getter 120.55 ms/op 120.59 ms/op 1.00
250000 validators batchHash() 100.88 ms/op 80.707 ms/op 1.25
250000 validators hashComputations 16.560 ms/op 13.403 ms/op 1.24
bitlist bytes to struct (120,90) 929.00 ns/op 964.00 ns/op 0.96
bitlist bytes to tree (120,90) 3.6130 us/op 3.6930 us/op 0.98
bitlist bytes to struct (2048,2048) 1.3230 us/op 1.3410 us/op 0.99
bitlist bytes to tree (2048,2048) 4.4980 us/op 4.3120 us/op 1.04
ByteListType - deserialize 11.032 ms/op 8.0872 ms/op 1.36
BasicListType - deserialize 17.649 ms/op 17.501 ms/op 1.01
ByteListType - serialize 8.0051 ms/op 7.6720 ms/op 1.04
BasicListType - serialize 10.961 ms/op 12.735 ms/op 0.86
BasicListType - tree_convertToStruct 29.249 ms/op 29.663 ms/op 0.99
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.6221 ms/op 4.8328 ms/op 0.96
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.0710 ms/op 3.9799 ms/op 1.02
Array.push len 300000 empty Array - number 6.8485 ms/op 7.1715 ms/op 0.95
Array.set len 300000 from new Array - number 2.1523 ms/op 2.2612 ms/op 0.95
Array.set len 300000 - number 6.5863 ms/op 5.9269 ms/op 1.11
Uint8Array.set len 300000 504.42 us/op 539.23 us/op 0.94
Uint32Array.set len 300000 643.45 us/op 458.65 us/op 1.40
Container({a: uint8, b: uint8}) getViewDU x300000 49.513 ms/op 49.126 ms/op 1.01
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 11.681 ms/op 10.768 ms/op 1.08
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 198.47 ms/op 214.74 ms/op 0.92
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 274.82 ms/op 256.68 ms/op 1.07
List(Container) len 300000 ViewDU.get(i) 7.0777 ms/op 6.8412 ms/op 1.03
List(Container) len 300000 ViewDU.getReadonly(i) 6.7816 ms/op 6.3793 ms/op 1.06
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 39.131 ms/op 38.327 ms/op 1.02
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.2078 ms/op 5.0546 ms/op 1.03
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.4451 ms/op 5.9697 ms/op 1.08
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.3112 ms/op 5.9126 ms/op 1.07
Array.push len 300000 empty Array - object 6.5680 ms/op 5.9100 ms/op 1.11
Array.set len 300000 from new Array - object 2.2705 ms/op 1.9903 ms/op 1.14
Array.set len 300000 - object 6.6755 ms/op 5.9399 ms/op 1.12
cachePermanentRootStruct no cache 5.4520 us/op 5.8350 us/op 0.93
cachePermanentRootStruct with cache 204.00 ns/op 202.00 ns/op 1.01
epochParticipation len 250000 rws 7813 2.2381 ms/op 2.2079 ms/op 1.01
BeaconState ViewDU hashTreeRoot() vc=200000 108.23 ms/op 104.39 ms/op 1.04
BeaconState ViewDU recursive hash - commit step vc=200000 4.7088 ms/op 4.3694 ms/op 1.08
BeaconState ViewDU validator tree creation vc=10000 35.777 ms/op 34.769 ms/op 1.03
BeaconState ViewDU batchHashTreeRoot vc=200000 96.110 ms/op 95.448 ms/op 1.01
BeaconState ViewDU hashTreeRoot - commit step vc=200000 84.334 ms/op 84.812 ms/op 0.99
BeaconState ViewDU hashTreeRoot - hash step vc=200000 16.258 ms/op 15.164 ms/op 1.07
deserialize Attestation - tree 4.4110 us/op 4.0550 us/op 1.09
deserialize Attestation - struct 1.8820 us/op 1.9280 us/op 0.98
deserialize SignedAggregateAndProof - tree 3.9800 us/op 3.8610 us/op 1.03
deserialize SignedAggregateAndProof - struct 3.1570 us/op 2.9710 us/op 1.06
deserialize SyncCommitteeMessage - tree 1.1100 us/op 1.0570 us/op 1.05
deserialize SyncCommitteeMessage - struct 1.0580 us/op 1.0560 us/op 1.00
deserialize SignedContributionAndProof - tree 2.1980 us/op 2.1000 us/op 1.05
deserialize SignedContributionAndProof - struct 2.5180 us/op 2.2570 us/op 1.12
deserialize SignedBeaconBlock - tree 222.78 us/op 208.21 us/op 1.07
deserialize SignedBeaconBlock - struct 125.81 us/op 120.44 us/op 1.04
BeaconState vc 300000 - deserialize tree 622.52 ms/op 639.02 ms/op 0.97
BeaconState vc 300000 - serialize tree 143.86 ms/op 106.89 ms/op 1.35
BeaconState.historicalRoots vc 300000 - deserialize tree 735.00 ns/op 856.00 ns/op 0.86
BeaconState.historicalRoots vc 300000 - serialize tree 678.00 ns/op 683.00 ns/op 0.99
BeaconState.validators vc 300000 - deserialize tree 591.08 ms/op 577.60 ms/op 1.02
BeaconState.validators vc 300000 - serialize tree 102.79 ms/op 102.90 ms/op 1.00
BeaconState.balances vc 300000 - deserialize tree 23.677 ms/op 20.857 ms/op 1.14
BeaconState.balances vc 300000 - serialize tree 3.4854 ms/op 3.5011 ms/op 1.00
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 402.78 us/op 373.72 us/op 1.08
BeaconState.previousEpochParticipation vc 300000 - serialize tree 299.63 us/op 280.74 us/op 1.07
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 377.62 us/op 372.14 us/op 1.01
BeaconState.currentEpochParticipation vc 300000 - serialize tree 300.57 us/op 276.97 us/op 1.09
BeaconState.inactivityScores vc 300000 - deserialize tree 22.130 ms/op 23.779 ms/op 0.93
BeaconState.inactivityScores vc 300000 - serialize tree 3.3489 ms/op 3.5118 ms/op 0.95
hashTreeRoot Attestation - struct 18.964 us/op 20.644 us/op 0.92
hashTreeRoot Attestation - tree 9.1960 us/op 9.3950 us/op 0.98
hashTreeRoot SignedAggregateAndProof - struct 23.859 us/op 31.939 us/op 0.75
hashTreeRoot SignedAggregateAndProof - tree 13.128 us/op 13.052 us/op 1.01
hashTreeRoot SyncCommitteeMessage - struct 6.0140 us/op 6.7600 us/op 0.89
hashTreeRoot SyncCommitteeMessage - tree 3.2400 us/op 3.3160 us/op 0.98
hashTreeRoot SignedContributionAndProof - struct 16.258 us/op 17.317 us/op 0.94
hashTreeRoot SignedContributionAndProof - tree 8.9910 us/op 9.0480 us/op 0.99
hashTreeRoot SignedBeaconBlock - struct 1.2695 ms/op 1.5513 ms/op 0.82
hashTreeRoot SignedBeaconBlock - tree 790.82 us/op 793.26 us/op 1.00
hashTreeRoot Validator - struct 7.5490 us/op 9.4330 us/op 0.80
hashTreeRoot Validator - tree 6.3290 us/op 7.1940 us/op 0.88
BeaconState vc 300000 - hashTreeRoot tree 2.1427 s/op 2.1274 s/op 1.01
BeaconState vc 300000 - batchHashTreeRoot tree 3.5179 s/op 3.4219 s/op 1.03
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.0770 us/op 988.00 ns/op 1.09
BeaconState.validators vc 300000 - hashTreeRoot tree 2.1964 s/op 2.1387 s/op 1.03
BeaconState.balances vc 300000 - hashTreeRoot tree 36.500 ms/op 33.181 ms/op 1.10
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.1553 ms/op 4.0860 ms/op 1.02
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.1647 ms/op 4.0867 ms/op 1.02
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 37.661 ms/op 33.022 ms/op 1.14
hash64 x18 9.9090 us/op 11.957 us/op 0.83
hashTwoObjects x18 8.9650 us/op 12.337 us/op 0.73
hash64 x1740 910.25 us/op 1.0911 ms/op 0.83
hashTwoObjects x1740 829.78 us/op 1.1583 ms/op 0.72
hash64 x2700000 1.3935 s/op 1.6925 s/op 0.82
hashTwoObjects x2700000 1.3028 s/op 1.8197 s/op 0.72
get_exitEpoch - ContainerType 388.00 ns/op 618.00 ns/op 0.63
get_exitEpoch - ContainerNodeStructType 388.00 ns/op 622.00 ns/op 0.62
set_exitEpoch - ContainerType 403.00 ns/op 641.00 ns/op 0.63
set_exitEpoch - ContainerNodeStructType 394.00 ns/op 635.00 ns/op 0.62
get_pubkey - ContainerType 901.00 ns/op 2.1500 us/op 0.42
get_pubkey - ContainerNodeStructType 376.00 ns/op 603.00 ns/op 0.62
hashTreeRoot - ContainerType 653.00 ns/op 1.0140 us/op 0.64
hashTreeRoot - ContainerNodeStructType 667.00 ns/op 1.0550 us/op 0.63
createProof - ContainerType 6.6400 us/op 7.2030 us/op 0.92
createProof - ContainerNodeStructType 26.415 us/op 32.369 us/op 0.82
serialize - ContainerType 2.3500 us/op 2.2660 us/op 1.04
serialize - ContainerNodeStructType 1.7370 us/op 1.6740 us/op 1.04
set_exitEpoch_and_hashTreeRoot - ContainerType 3.3680 us/op 3.1040 us/op 1.09
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 9.0310 us/op 7.6240 us/op 1.18
Array - for of 12.020 us/op 5.6620 us/op 2.12
Array - for(;;) 12.350 us/op 5.7570 us/op 2.15
basicListValue.readonlyValuesArray() 5.2405 ms/op 4.5532 ms/op 1.15
basicListValue.readonlyValuesArray() + loop all 5.2224 ms/op 4.6071 ms/op 1.13
compositeListValue.readonlyValuesArray() 31.548 ms/op 27.373 ms/op 1.15
compositeListValue.readonlyValuesArray() + loop all 30.413 ms/op 27.646 ms/op 1.10
Number64UintType - get balances list 4.6462 ms/op 4.1377 ms/op 1.12
Number64UintType - set balances list 10.134 ms/op 9.9409 ms/op 1.02
Number64UintType - get and increase 10 then set 41.347 ms/op 40.810 ms/op 1.01
Number64UintType - increase 10 using applyDelta 17.349 ms/op 15.926 ms/op 1.09
Number64UintType - increase 10 using applyDeltaInBatch 17.286 ms/op 15.997 ms/op 1.08
tree_newTreeFromUint64Deltas 18.481 ms/op 17.334 ms/op 1.07
unsafeUint8ArrayToTree 33.467 ms/op 32.137 ms/op 1.04
bitLength(50) 251.00 ns/op 232.00 ns/op 1.08
bitLengthStr(50) 214.00 ns/op 222.00 ns/op 0.96
bitLength(8000) 240.00 ns/op 219.00 ns/op 1.10
bitLengthStr(8000) 264.00 ns/op 262.00 ns/op 1.01
bitLength(250000) 243.00 ns/op 219.00 ns/op 1.11
bitLengthStr(250000) 292.00 ns/op 300.00 ns/op 0.97
floor - Math.floor (53) 1.2373 ns/op 1.2370 ns/op 1.00
floor - << 0 (53) 1.2388 ns/op 1.2398 ns/op 1.00
floor - Math.floor (512) 1.2366 ns/op 1.2368 ns/op 1.00
floor - << 0 (512) 1.2368 ns/op 1.2369 ns/op 1.00
fnIf(0) 1.5458 ns/op 1.5519 ns/op 1.00
fnSwitch(0) 2.1688 ns/op 2.1646 ns/op 1.00
fnObj(0) 1.5530 ns/op 1.5477 ns/op 1.00
fnArr(0) 1.5450 ns/op 1.5472 ns/op 1.00
fnIf(4) 2.1642 ns/op 2.1718 ns/op 1.00
fnSwitch(4) 2.1683 ns/op 2.2115 ns/op 0.98
fnObj(4) 1.5523 ns/op 1.5479 ns/op 1.00
fnArr(4) 1.5469 ns/op 1.5544 ns/op 1.00
fnIf(9) 3.0923 ns/op 3.0913 ns/op 1.00
fnSwitch(9) 2.1642 ns/op 2.1645 ns/op 1.00
fnObj(9) 1.5463 ns/op 1.5515 ns/op 1.00
fnArr(9) 1.5489 ns/op 1.5495 ns/op 1.00
Container {a,b,vec} - as struct x100000 123.75 us/op 123.83 us/op 1.00
Container {a,b,vec} - as tree x100000 341.27 us/op 340.48 us/op 1.00
Container {a,vec,b} - as struct x100000 154.82 us/op 155.27 us/op 1.00
Container {a,vec,b} - as tree x100000 376.59 us/op 376.95 us/op 1.00
get 2 props x1000000 - rawObject 309.74 us/op 309.74 us/op 1.00
get 2 props x1000000 - proxy 73.630 ms/op 73.814 ms/op 1.00
get 2 props x1000000 - customObj 310.07 us/op 309.40 us/op 1.00
Simple object binary -> struct 711.00 ns/op 843.00 ns/op 0.84
Simple object binary -> tree_backed 1.2990 us/op 1.7310 us/op 0.75
Simple object struct -> tree_backed 1.9050 us/op 2.4210 us/op 0.79
Simple object tree_backed -> struct 1.8520 us/op 2.3100 us/op 0.80
Simple object struct -> binary 943.00 ns/op 1.1690 us/op 0.81
Simple object tree_backed -> binary 1.5830 us/op 1.6010 us/op 0.99
aggregationBits binary -> struct 623.00 ns/op 616.00 ns/op 1.01
aggregationBits binary -> tree_backed 2.3940 us/op 2.4930 us/op 0.96
aggregationBits struct -> tree_backed 2.8160 us/op 2.8900 us/op 0.97
aggregationBits tree_backed -> struct 1.2160 us/op 1.2690 us/op 0.96
aggregationBits struct -> binary 807.00 ns/op 785.00 ns/op 1.03
aggregationBits tree_backed -> binary 1.0430 us/op 1.0780 us/op 0.97
List(uint8) 100000 binary -> struct 1.5011 ms/op 1.3611 ms/op 1.10
List(uint8) 100000 binary -> tree_backed 97.151 us/op 91.721 us/op 1.06
List(uint8) 100000 struct -> tree_backed 1.2675 ms/op 1.1277 ms/op 1.12
List(uint8) 100000 tree_backed -> struct 1.2082 ms/op 1.0331 ms/op 1.17
List(uint8) 100000 struct -> binary 980.01 us/op 1.0071 ms/op 0.97
List(uint8) 100000 tree_backed -> binary 98.080 us/op 91.519 us/op 1.07
List(uint64Number) 100000 binary -> struct 1.4256 ms/op 1.1941 ms/op 1.19
List(uint64Number) 100000 binary -> tree_backed 3.5107 ms/op 3.2774 ms/op 1.07
List(uint64Number) 100000 struct -> tree_backed 4.9856 ms/op 4.8642 ms/op 1.02
List(uint64Number) 100000 tree_backed -> struct 2.3457 ms/op 2.1910 ms/op 1.07
List(uint64Number) 100000 struct -> binary 1.5586 ms/op 1.3603 ms/op 1.15
List(uint64Number) 100000 tree_backed -> binary 934.50 us/op 905.49 us/op 1.03
List(Uint64Bigint) 100000 binary -> struct 3.7388 ms/op 3.7756 ms/op 0.99
List(Uint64Bigint) 100000 binary -> tree_backed 3.6414 ms/op 3.6574 ms/op 1.00
List(Uint64Bigint) 100000 struct -> tree_backed 5.5094 ms/op 5.6519 ms/op 0.97
List(Uint64Bigint) 100000 tree_backed -> struct 4.8989 ms/op 4.6726 ms/op 1.05
List(Uint64Bigint) 100000 struct -> binary 2.0485 ms/op 2.0692 ms/op 0.99
List(Uint64Bigint) 100000 tree_backed -> binary 1.1416 ms/op 861.91 us/op 1.32
Vector(Root) 100000 binary -> struct 33.250 ms/op 30.952 ms/op 1.07
Vector(Root) 100000 binary -> tree_backed 32.082 ms/op 34.539 ms/op 0.93
Vector(Root) 100000 struct -> tree_backed 41.953 ms/op 39.299 ms/op 1.07
Vector(Root) 100000 tree_backed -> struct 47.604 ms/op 45.190 ms/op 1.05
Vector(Root) 100000 struct -> binary 2.7710 ms/op 2.6132 ms/op 1.06
Vector(Root) 100000 tree_backed -> binary 10.529 ms/op 9.2572 ms/op 1.14
List(Validator) 100000 binary -> struct 104.81 ms/op 108.52 ms/op 0.97
List(Validator) 100000 binary -> tree_backed 309.68 ms/op 296.50 ms/op 1.04
List(Validator) 100000 struct -> tree_backed 326.50 ms/op 301.50 ms/op 1.08
List(Validator) 100000 tree_backed -> struct 208.82 ms/op 205.86 ms/op 1.01
List(Validator) 100000 struct -> binary 28.981 ms/op 27.630 ms/op 1.05
List(Validator) 100000 tree_backed -> binary 118.19 ms/op 115.33 ms/op 1.02
List(Validator-NS) 100000 binary -> struct 107.20 ms/op 111.86 ms/op 0.96
List(Validator-NS) 100000 binary -> tree_backed 156.00 ms/op 152.60 ms/op 1.02
List(Validator-NS) 100000 struct -> tree_backed 196.30 ms/op 190.75 ms/op 1.03
List(Validator-NS) 100000 tree_backed -> struct 179.40 ms/op 167.24 ms/op 1.07
List(Validator-NS) 100000 struct -> binary 29.098 ms/op 26.850 ms/op 1.08
List(Validator-NS) 100000 tree_backed -> binary 35.880 ms/op 32.632 ms/op 1.10
get epochStatuses - MutableVector 127.78 us/op 122.77 us/op 1.04
get epochStatuses - ViewDU 201.50 us/op 201.22 us/op 1.00
set epochStatuses - ListTreeView 1.6923 ms/op 1.6703 ms/op 1.01
set epochStatuses - ListTreeView - set() 440.18 us/op 468.48 us/op 0.94
set epochStatuses - ListTreeView - commit() 524.28 us/op 573.78 us/op 0.91
bitstring 642.23 ns/op 643.23 ns/op 1.00
bit mask 13.506 ns/op 14.083 ns/op 0.96
struct - increase slot to 1000000 928.76 us/op 927.89 us/op 1.00
UintNumberType - increase slot to 1000000 21.365 ms/op 22.282 ms/op 0.96
UintBigintType - increase slot to 1000000 179.69 ms/op 166.33 ms/op 1.08
UintBigint8 x 100000 tree_deserialize 4.8359 ms/op 4.9297 ms/op 0.98
UintBigint8 x 100000 tree_serialize 1.1827 ms/op 1.0926 ms/op 1.08
UintBigint16 x 100000 tree_deserialize 4.4298 ms/op 4.9484 ms/op 0.90
UintBigint16 x 100000 tree_serialize 1.2861 ms/op 1.2837 ms/op 1.00
UintBigint32 x 100000 tree_deserialize 4.9298 ms/op 5.2379 ms/op 0.94
UintBigint32 x 100000 tree_serialize 1.2795 ms/op 1.2957 ms/op 0.99
UintBigint64 x 100000 tree_deserialize 5.8358 ms/op 5.5047 ms/op 1.06
UintBigint64 x 100000 tree_serialize 1.7352 ms/op 1.6591 ms/op 1.05
UintBigint8 x 100000 value_deserialize 433.39 us/op 433.58 us/op 1.00
UintBigint8 x 100000 value_serialize 709.26 us/op 721.92 us/op 0.98
UintBigint16 x 100000 value_deserialize 464.20 us/op 463.87 us/op 1.00
UintBigint16 x 100000 value_serialize 726.94 us/op 779.96 us/op 0.93
UintBigint32 x 100000 value_deserialize 433.26 us/op 433.05 us/op 1.00
UintBigint32 x 100000 value_serialize 767.00 us/op 764.62 us/op 1.00
UintBigint64 x 100000 value_deserialize 496.19 us/op 496.00 us/op 1.00
UintBigint64 x 100000 value_serialize 965.18 us/op 935.17 us/op 1.03
UintBigint8 x 100000 deserialize 3.3941 ms/op 3.3991 ms/op 1.00
UintBigint8 x 100000 serialize 1.7709 ms/op 1.5510 ms/op 1.14
UintBigint16 x 100000 deserialize 3.4997 ms/op 3.3767 ms/op 1.04
UintBigint16 x 100000 serialize 1.5105 ms/op 1.6018 ms/op 0.94
UintBigint32 x 100000 deserialize 3.6577 ms/op 3.5770 ms/op 1.02
UintBigint32 x 100000 serialize 2.9284 ms/op 2.9731 ms/op 0.98
UintBigint64 x 100000 deserialize 4.2231 ms/op 4.2846 ms/op 0.99
UintBigint64 x 100000 serialize 1.5594 ms/op 1.5770 ms/op 0.99
UintBigint128 x 100000 deserialize 5.7371 ms/op 6.0226 ms/op 0.95
UintBigint128 x 100000 serialize 16.416 ms/op 14.634 ms/op 1.12
UintBigint256 x 100000 deserialize 9.2334 ms/op 7.9220 ms/op 1.17
UintBigint256 x 100000 serialize 46.503 ms/op 42.564 ms/op 1.09
Slice from Uint8Array x25000 1.3702 ms/op 1.2222 ms/op 1.12
Slice from ArrayBuffer x25000 16.148 ms/op 15.521 ms/op 1.04
Slice from ArrayBuffer x25000 + new Uint8Array 17.857 ms/op 15.437 ms/op 1.16
Copy Uint8Array 100000 iterate 2.6082 ms/op 1.6754 ms/op 1.56
Copy Uint8Array 100000 slice 126.42 us/op 115.84 us/op 1.09
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 125.57 us/op 112.79 us/op 1.11
Copy Buffer 100000 Uint8Array.prototype.slice.call 126.18 us/op 113.59 us/op 1.11
Copy Uint8Array 100000 slice + set 204.99 us/op 169.80 us/op 1.21
Copy Uint8Array 100000 subarray + set 125.97 us/op 112.90 us/op 1.12
Copy Uint8Array 100000 slice arrayBuffer 126.08 us/op 114.07 us/op 1.11
Uint64 deserialize 100000 - iterate Uint8Array 1.8981 ms/op 1.7962 ms/op 1.06
Uint64 deserialize 100000 - by Uint32A 1.8983 ms/op 1.8299 ms/op 1.04
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.9363 ms/op 1.8006 ms/op 1.08
Uint64 deserialize 100000 - by DataView.getBigUint64 5.0159 ms/op 4.9245 ms/op 1.02
Uint64 deserialize 100000 - by byte 40.877 ms/op 40.026 ms/op 1.02

by benchmarkbot/action

@twoeths twoeths requested a review from wemeetagain November 7, 2024 12:55
@twoeths twoeths merged commit e58781f into master Nov 9, 2024
8 checks passed
@twoeths twoeths deleted the te/add_merkleize_block_array branch November 9, 2024 02:14
@twoeths twoeths restored the te/add_merkleize_block_array branch November 9, 2024 02:15
@twoeths twoeths deleted the te/add_merkleize_block_array branch November 9, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants