Skip to content

Conversation

@twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 12, 2025

Motivation

  • avoid memory allocation when consumer want to loop through all item of a ListComposite

Description

  • new forEach() & forEachValue() api: no memory allocation for array needed
  • optional "out" param for getAll() apis so that consumer can allocate memory once and reuse if they want to

cherry-picked from #417

@twoeths twoeths requested a review from a team as a code owner March 12, 2025 08:26
@github-actions github-actions bot added the ssz label Mar 12, 2025
@github-actions
Copy link

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 46361a2 Previous: 66742f0 Ratio
digestTwoHashObjects 50023 times 48.279 ms/op 48.222 ms/op 1.00
digest2Bytes32 50023 times 54.222 ms/op 54.992 ms/op 0.99
digest 50023 times 52.828 ms/op 54.116 ms/op 0.98
input length 32 1.1750 us/op 1.1750 us/op 1.00
input length 64 1.2960 us/op 1.2840 us/op 1.01
input length 128 2.2590 us/op 2.2590 us/op 1.00
input length 256 3.3540 us/op 3.3550 us/op 1.00
input length 512 5.5520 us/op 5.5060 us/op 1.01
input length 1024 10.694 us/op 10.674 us/op 1.00
digest 1000000 times 851.09 ms/op 856.13 ms/op 0.99
hashObjectToByteArray 50023 times 1.2290 ms/op 1.2288 ms/op 1.00
byteArrayToHashObject 50023 times 1.5401 ms/op 1.5668 ms/op 0.98
digest64 200092 times 218.49 ms/op 214.68 ms/op 1.02
hash 200092 times using batchHash4UintArray64s 233.87 ms/op 241.19 ms/op 0.97
digest64HashObjects 200092 times 191.78 ms/op 192.94 ms/op 0.99
hash 200092 times using batchHash4HashObjectInputs 202.18 ms/op 201.07 ms/op 1.01
getGindicesAtDepth 3.4690 us/op 3.4420 us/op 1.01
iterateAtDepth 6.2400 us/op 6.3610 us/op 0.98
getGindexBits 363.00 ns/op 362.00 ns/op 1.00
gindexIterator 832.00 ns/op 817.00 ns/op 1.02
HashComputationLevel.push then loop 25.904 ms/op 26.614 ms/op 0.97
HashComputation[] push then loop 48.941 ms/op 49.268 ms/op 0.99
hash 2 Uint8Array 500000 times - hashtree 220.01 ms/op 226.33 ms/op 0.97
hashTwoObjects 500000 times - hashtree 208.50 ms/op 219.51 ms/op 0.95
executeHashComputations - hashtree 9.3730 ms/op 10.982 ms/op 0.85
hash 2 Uint8Array 500000 times - as-sha256 551.61 ms/op 562.87 ms/op 0.98
hashTwoObjects 500000 times - as-sha256 511.01 ms/op 508.70 ms/op 1.00
executeHashComputations - as-sha256 44.913 ms/op 45.292 ms/op 0.99
hash 2 Uint8Array 500000 times - noble 1.2084 s/op 1.2128 s/op 1.00
hashTwoObjects 500000 times - noble 1.6408 s/op 1.6214 s/op 1.01
executeHashComputations - noble 37.243 ms/op 37.232 ms/op 1.00
getHashComputations 2.5151 ms/op 2.3259 ms/op 1.08
executeHashComputations 9.3058 ms/op 10.151 ms/op 0.92
get root 16.968 ms/op 15.784 ms/op 1.08
getNodeH() x7812.5 avg hindex 12.272 us/op 12.416 us/op 0.99
getNodeH() x7812.5 index 0 7.6100 us/op 7.4840 us/op 1.02
getNodeH() x7812.5 index 7 7.5010 us/op 7.4470 us/op 1.01
getNodeH() x7812.5 index 7 with key array 6.3690 us/op 6.3550 us/op 1.00
new LeafNode() x7812.5 311.30 us/op 301.29 us/op 1.03
getHashComputations 250000 nodes 14.707 ms/op 14.746 ms/op 1.00
batchHash 250000 nodes 90.756 ms/op 87.475 ms/op 1.04
get root 250000 nodes 129.87 ms/op 117.51 ms/op 1.11
getHashComputations 500000 nodes 29.341 ms/op 30.366 ms/op 0.97
batchHash 500000 nodes 157.46 ms/op 155.73 ms/op 1.01
get root 500000 nodes 257.61 ms/op 236.35 ms/op 1.09
getHashComputations 1000000 nodes 92.942 ms/op 82.758 ms/op 1.12
batchHash 1000000 nodes 360.46 ms/op 368.65 ms/op 0.98
get root 1000000 nodes 511.58 ms/op 469.26 ms/op 1.09
multiproof - depth 15, 1 requested leaves 8.0280 us/op 8.0150 us/op 1.00
tree offset multiproof - depth 15, 1 requested leaves 17.645 us/op 17.841 us/op 0.99
compact multiproof - depth 15, 1 requested leaves 3.0480 us/op 3.0990 us/op 0.98
multiproof - depth 15, 2 requested leaves 11.515 us/op 11.361 us/op 1.01
tree offset multiproof - depth 15, 2 requested leaves 21.308 us/op 21.610 us/op 0.99
compact multiproof - depth 15, 2 requested leaves 2.9540 us/op 3.1000 us/op 0.95
multiproof - depth 15, 3 requested leaves 16.253 us/op 16.107 us/op 1.01
tree offset multiproof - depth 15, 3 requested leaves 27.876 us/op 28.342 us/op 0.98
compact multiproof - depth 15, 3 requested leaves 3.6390 us/op 3.7830 us/op 0.96
multiproof - depth 15, 4 requested leaves 21.287 us/op 21.079 us/op 1.01
tree offset multiproof - depth 15, 4 requested leaves 34.219 us/op 33.950 us/op 1.01
compact multiproof - depth 15, 4 requested leaves 4.3070 us/op 4.4900 us/op 0.96
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.6130 us/op 5.5470 us/op 1.01
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.6610 us/op 5.6800 us/op 1.00
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.7080 us/op 5.5690 us/op 1.02
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.5570 us/op 5.5490 us/op 1.00
subtreeFillToContents depth 40 count 250000 48.704 ms/op 47.981 ms/op 1.02
setRoot - gindexBitstring 20.754 ms/op 21.328 ms/op 0.97
setRoot - gindex 21.402 ms/op 21.917 ms/op 0.98
getRoot - gindexBitstring 2.5085 ms/op 2.6404 ms/op 0.95
getRoot - gindex 3.0721 ms/op 3.1563 ms/op 0.97
getHashObject then setHashObject 21.857 ms/op 22.657 ms/op 0.96
setNodeWithFn 19.501 ms/op 20.203 ms/op 0.97
getNodeAtDepth depth 0 x100000 280.00 us/op 280.97 us/op 1.00
setNodeAtDepth depth 0 x100000 2.5543 ms/op 2.6096 ms/op 0.98
getNodesAtDepth depth 0 x100000 316.35 us/op 312.48 us/op 1.01
setNodesAtDepth depth 0 x100000 759.21 us/op 766.38 us/op 0.99
getNodeAtDepth depth 1 x100000 345.75 us/op 342.26 us/op 1.01
setNodeAtDepth depth 1 x100000 8.1413 ms/op 8.3236 ms/op 0.98
getNodesAtDepth depth 1 x100000 436.93 us/op 437.18 us/op 1.00
setNodesAtDepth depth 1 x100000 6.7147 ms/op 6.8082 ms/op 0.99
getNodeAtDepth depth 2 x100000 920.21 us/op 747.84 us/op 1.23
setNodeAtDepth depth 2 x100000 15.211 ms/op 15.759 ms/op 0.97
getNodesAtDepth depth 2 x100000 17.770 ms/op 17.832 ms/op 1.00
setNodesAtDepth depth 2 x100000 23.082 ms/op 23.473 ms/op 0.98
tree.getNodesAtDepth - gindexes 7.3389 ms/op 10.184 ms/op 0.72
tree.getNodesAtDepth - push all nodes 2.2250 ms/op 2.4072 ms/op 0.92
tree.getNodesAtDepth - navigation 312.46 us/op 311.81 us/op 1.00
tree.setNodesAtDepth - indexes 693.58 us/op 721.20 us/op 0.96
set at depth 8 760.00 ns/op 782.00 ns/op 0.97
set at depth 16 1.1150 us/op 1.2550 us/op 0.89
set at depth 32 1.9070 us/op 2.1260 us/op 0.90
iterateNodesAtDepth 8 256 13.723 us/op 15.250 us/op 0.90
getNodesAtDepth 8 256 3.6990 us/op 4.2120 us/op 0.88
iterateNodesAtDepth 16 65536 4.5508 ms/op 5.4861 ms/op 0.83
getNodesAtDepth 16 65536 1.9801 ms/op 1.5647 ms/op 1.27
iterateNodesAtDepth 32 250000 16.258 ms/op 16.057 ms/op 1.01
getNodesAtDepth 32 250000 4.9024 ms/op 4.5628 ms/op 1.07
iterateNodesAtDepth 40 250000 16.448 ms/op 16.026 ms/op 1.03
getNodesAtDepth 40 250000 5.0292 ms/op 4.5134 ms/op 1.11
250000 validators root getter 129.24 ms/op 118.47 ms/op 1.09
250000 validators batchHash() 90.898 ms/op 89.039 ms/op 1.02
250000 validators hashComputations 18.584 ms/op 14.514 ms/op 1.28
bitlist bytes to struct (120,90) 876.00 ns/op 803.00 ns/op 1.09
bitlist bytes to tree (120,90) 2.7440 us/op 3.1120 us/op 0.88
bitlist bytes to struct (2048,2048) 1.0740 us/op 1.1780 us/op 0.91
bitlist bytes to tree (2048,2048) 4.2980 us/op 4.1770 us/op 1.03
ByteListType - deserialize 7.6988 ms/op 7.6613 ms/op 1.00
BasicListType - deserialize 16.011 ms/op 14.691 ms/op 1.09
ByteListType - serialize 7.3996 ms/op 7.6780 ms/op 0.96
BasicListType - serialize 10.301 ms/op 10.404 ms/op 0.99
BasicListType - tree_convertToStruct 28.297 ms/op 26.817 ms/op 1.06
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.9959 ms/op 4.7325 ms/op 1.06
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.3861 ms/op 4.3983 ms/op 1.00
Array.push len 300000 empty Array - number 6.4254 ms/op 7.0984 ms/op 0.91
Array.set len 300000 from new Array - number 2.0983 ms/op 1.9535 ms/op 1.07
Array.set len 300000 - number 5.8751 ms/op 6.4557 ms/op 0.91
Uint8Array.set len 300000 507.80 us/op 490.96 us/op 1.03
Uint32Array.set len 300000 558.98 us/op 570.53 us/op 0.98
Container({a: uint8, b: uint8}) getViewDU x300000 25.094 ms/op 25.517 ms/op 0.98
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 10.526 ms/op 10.595 ms/op 0.99
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 201.93 ms/op 212.90 ms/op 0.95
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 243.23 ms/op 251.94 ms/op 0.97
List(Container) len 300000 ViewDU.get(i) 6.3508 ms/op 7.1620 ms/op 0.89
List(Container) len 300000 ViewDU.getReadonly(i) 6.4556 ms/op 6.8957 ms/op 0.94
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 36.808 ms/op 38.732 ms/op 0.95
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.2310 ms/op 5.1944 ms/op 1.01
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.0030 ms/op 6.4012 ms/op 0.94
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.0072 ms/op 6.2103 ms/op 0.97
Array.push len 300000 empty Array - object 6.4953 ms/op 7.0492 ms/op 0.92
Array.set len 300000 from new Array - object 2.2465 ms/op 2.0988 ms/op 1.07
Array.set len 300000 - object 6.1914 ms/op 6.3088 ms/op 0.98
cachePermanentRootStruct no cache 3.3910 us/op 3.5280 us/op 0.96
cachePermanentRootStruct with cache 201.00 ns/op 215.00 ns/op 0.93
epochParticipation len 250000 rws 7813 2.2611 ms/op 2.4713 ms/op 0.91
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 5.1930 ms/op 5.4818 ms/op 0.95
BeaconState ViewDU hashTreeRoot() vc=200000 109.96 ms/op 114.36 ms/op 0.96
BeaconState ViewDU recursive hash - commit step vc=200000 4.6307 ms/op 4.9293 ms/op 0.94
BeaconState ViewDU validator tree creation vc=10000 38.236 ms/op 39.187 ms/op 0.98
BeaconState ViewDU batchHashTreeRoot vc=200000 99.714 ms/op 99.795 ms/op 1.00
BeaconState ViewDU hashTreeRoot - commit step vc=200000 88.508 ms/op 91.570 ms/op 0.97
BeaconState ViewDU hashTreeRoot - hash step vc=200000 16.649 ms/op 16.207 ms/op 1.03
deserialize Attestation - tree 3.5240 us/op 3.5440 us/op 0.99
deserialize Attestation - struct 1.8230 us/op 1.8600 us/op 0.98
deserialize SignedAggregateAndProof - tree 4.6700 us/op 4.7280 us/op 0.99
deserialize SignedAggregateAndProof - struct 2.9290 us/op 3.0400 us/op 0.96
deserialize SyncCommitteeMessage - tree 1.3380 us/op 1.3940 us/op 0.96
deserialize SyncCommitteeMessage - struct 1.0900 us/op 1.0370 us/op 1.05
deserialize SignedContributionAndProof - tree 2.8180 us/op 2.8810 us/op 0.98
deserialize SignedContributionAndProof - struct 2.2330 us/op 2.3670 us/op 0.94
deserialize SignedBeaconBlock - tree 274.13 us/op 277.57 us/op 0.99
deserialize SignedBeaconBlock - struct 120.67 us/op 120.75 us/op 1.00
BeaconState vc 300000 - deserialize tree 629.86 ms/op 636.97 ms/op 0.99
BeaconState vc 300000 - serialize tree 176.35 ms/op 150.68 ms/op 1.17
BeaconState.historicalRoots vc 300000 - deserialize tree 830.00 ns/op 869.00 ns/op 0.96
BeaconState.historicalRoots vc 300000 - serialize tree 622.00 ns/op 641.00 ns/op 0.97
BeaconState.validators vc 300000 - deserialize tree 592.57 ms/op 603.80 ms/op 0.98
BeaconState.validators vc 300000 - serialize tree 133.71 ms/op 101.55 ms/op 1.32
BeaconState.balances vc 300000 - deserialize tree 27.856 ms/op 27.419 ms/op 1.02
BeaconState.balances vc 300000 - serialize tree 3.9700 ms/op 4.2650 ms/op 0.93
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 930.02 us/op 957.52 us/op 0.97
BeaconState.previousEpochParticipation vc 300000 - serialize tree 344.15 us/op 335.71 us/op 1.03
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 930.76 us/op 979.31 us/op 0.95
BeaconState.currentEpochParticipation vc 300000 - serialize tree 341.41 us/op 346.11 us/op 0.99
BeaconState.inactivityScores vc 300000 - deserialize tree 27.548 ms/op 26.139 ms/op 1.05
BeaconState.inactivityScores vc 300000 - serialize tree 4.3295 ms/op 3.7034 ms/op 1.17
hashTreeRoot Attestation - struct 14.808 us/op 12.538 us/op 1.18
hashTreeRoot Attestation - tree 8.9720 us/op 9.2210 us/op 0.97
hashTreeRoot SignedAggregateAndProof - struct 17.376 us/op 15.470 us/op 1.12
hashTreeRoot SignedAggregateAndProof - tree 13.378 us/op 13.814 us/op 0.97
hashTreeRoot SyncCommitteeMessage - struct 4.1870 us/op 3.8950 us/op 1.07
hashTreeRoot SyncCommitteeMessage - tree 3.6260 us/op 3.6700 us/op 0.99
hashTreeRoot SignedContributionAndProof - struct 9.8250 us/op 9.3520 us/op 1.05
hashTreeRoot SignedContributionAndProof - tree 9.1800 us/op 9.5910 us/op 0.96
hashTreeRoot SignedBeaconBlock - struct 804.58 us/op 810.91 us/op 0.99
hashTreeRoot SignedBeaconBlock - tree 790.82 us/op 815.41 us/op 0.97
hashTreeRoot Validator - struct 4.7400 us/op 4.6240 us/op 1.03
hashTreeRoot Validator - tree 7.1740 us/op 6.8680 us/op 1.04
BeaconState vc 300000 - hashTreeRoot tree 2.2527 s/op 2.2760 s/op 0.99
BeaconState vc 300000 - batchHashTreeRoot tree 4.0732 s/op 4.1719 s/op 0.98
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 987.00 ns/op 1.0290 us/op 0.96
BeaconState.validators vc 300000 - hashTreeRoot tree 2.4366 s/op 2.4439 s/op 1.00
BeaconState.balances vc 300000 - hashTreeRoot tree 34.368 ms/op 35.258 ms/op 0.97
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.3212 ms/op 4.3481 ms/op 0.99
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.2153 ms/op 4.3738 ms/op 0.96
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 41.356 ms/op 35.154 ms/op 1.18
hash64 x18 8.8600 us/op 9.2910 us/op 0.95
hashTwoObjects x18 8.1430 us/op 8.2050 us/op 0.99
hash64 x1740 833.53 us/op 845.90 us/op 0.99
hashTwoObjects x1740 735.80 us/op 754.53 us/op 0.98
hash64 x2700000 1.2376 s/op 1.3273 s/op 0.93
hashTwoObjects x2700000 1.1311 s/op 1.1687 s/op 0.97
get_exitEpoch - ContainerType 239.00 ns/op 253.00 ns/op 0.94
get_exitEpoch - ContainerNodeStructType 255.00 ns/op 241.00 ns/op 1.06
set_exitEpoch - ContainerType 268.00 ns/op 260.00 ns/op 1.03
set_exitEpoch - ContainerNodeStructType 233.00 ns/op 242.00 ns/op 0.96
get_pubkey - ContainerType 934.00 ns/op 1.0660 us/op 0.88
get_pubkey - ContainerNodeStructType 229.00 ns/op 245.00 ns/op 0.93
hashTreeRoot - ContainerType 386.00 ns/op 430.00 ns/op 0.90
hashTreeRoot - ContainerNodeStructType 398.00 ns/op 405.00 ns/op 0.98
createProof - ContainerType 3.9470 us/op 4.1840 us/op 0.94
createProof - ContainerNodeStructType 21.370 us/op 21.256 us/op 1.01
serialize - ContainerType 1.7100 us/op 1.7530 us/op 0.98
serialize - ContainerNodeStructType 1.3770 us/op 1.4820 us/op 0.93
set_exitEpoch_and_hashTreeRoot - ContainerType 2.6670 us/op 3.0160 us/op 0.88
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 8.0240 us/op 7.5180 us/op 1.07
Array - for of 7.8690 us/op 8.2010 us/op 0.96
Array - for(;;) 7.3830 us/op 8.1920 us/op 0.90
basicListValue.readonlyValuesArray() 4.7768 ms/op 4.3237 ms/op 1.10
basicListValue.readonlyValuesArray() + loop all 4.8849 ms/op 4.4085 ms/op 1.11
compositeListValue.readonlyValuesArray() 30.851 ms/op 32.724 ms/op 0.94
compositeListValue.readonlyValuesArray() + loop all 31.970 ms/op 27.708 ms/op 1.15
Number64UintType - get balances list 4.4337 ms/op 4.4544 ms/op 1.00
Number64UintType - set balances list 10.413 ms/op 10.006 ms/op 1.04
Number64UintType - get and increase 10 then set 42.992 ms/op 43.954 ms/op 0.98
Number64UintType - increase 10 using applyDelta 16.464 ms/op 16.506 ms/op 1.00
Number64UintType - increase 10 using applyDeltaInBatch 16.456 ms/op 16.997 ms/op 0.97
tree_newTreeFromUint64Deltas 21.504 ms/op 22.861 ms/op 0.94
unsafeUint8ArrayToTree 38.121 ms/op 39.401 ms/op 0.97
bitLength(50) 237.00 ns/op 267.00 ns/op 0.89
bitLengthStr(50) 223.00 ns/op 236.00 ns/op 0.94
bitLength(8000) 237.00 ns/op 237.00 ns/op 1.00
bitLengthStr(8000) 280.00 ns/op 289.00 ns/op 0.97
bitLength(250000) 229.00 ns/op 255.00 ns/op 0.90
bitLengthStr(250000) 311.00 ns/op 309.00 ns/op 1.01
merkleize 32 chunks 15.049 us/op 15.464 us/op 0.97
merkleizeBlocksBytes 32 chunks 3.4290 us/op 3.5450 us/op 0.97
merkleizeBlockArray 32 chunks 6.5480 us/op 6.6910 us/op 0.98
merkleize 128 chunks 57.088 us/op 64.735 us/op 0.88
merkleizeBlocksBytes 128 chunks 7.8700 us/op 7.8900 us/op 1.00
merkleizeBlockArray 128 chunks 18.054 us/op 18.990 us/op 0.95
merkleize 512 chunks 236.24 us/op 249.05 us/op 0.95
merkleizeBlocksBytes 512 chunks 23.384 us/op 23.294 us/op 1.00
merkleizeBlockArray 512 chunks 61.059 us/op 67.306 us/op 0.91
merkleize 1024 chunks 468.75 us/op 509.99 us/op 0.92
merkleizeBlocksBytes 1024 chunks 43.036 us/op 43.328 us/op 0.99
merkleizeBlockArray 1024 chunks 119.00 us/op 126.11 us/op 0.94
floor - Math.floor (53) 1.2433 ns/op 1.2433 ns/op 1.00
floor - << 0 (53) 1.2489 ns/op 1.2432 ns/op 1.00
floor - Math.floor (512) 1.2445 ns/op 1.2428 ns/op 1.00
floor - << 0 (512) 1.2440 ns/op 1.2430 ns/op 1.00
fnIf(0) 1.5568 ns/op 1.5554 ns/op 1.00
fnSwitch(0) 2.1807 ns/op 2.1749 ns/op 1.00
fnObj(0) 1.5578 ns/op 1.5570 ns/op 1.00
fnArr(0) 1.5546 ns/op 1.5542 ns/op 1.00
fnIf(4) 2.1957 ns/op 2.1792 ns/op 1.01
fnSwitch(4) 2.1816 ns/op 2.1850 ns/op 1.00
fnObj(4) 1.5942 ns/op 1.5601 ns/op 1.02
fnArr(4) 1.5573 ns/op 1.5547 ns/op 1.00
fnIf(9) 3.1094 ns/op 3.1152 ns/op 1.00
fnSwitch(9) 2.1750 ns/op 2.1769 ns/op 1.00
fnObj(9) 1.5639 ns/op 1.5721 ns/op 0.99
fnArr(9) 1.5542 ns/op 1.5549 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.82 us/op 124.81 us/op 1.00
Container {a,b,vec} - as tree x100000 562.48 us/op 559.79 us/op 1.00
Container {a,vec,b} - as struct x100000 160.06 us/op 156.00 us/op 1.03
Container {a,vec,b} - as tree x100000 560.72 us/op 559.94 us/op 1.00
get 2 props x1000000 - rawObject 311.11 us/op 311.25 us/op 1.00
get 2 props x1000000 - proxy 73.211 ms/op 73.088 ms/op 1.00
get 2 props x1000000 - customObj 311.23 us/op 311.50 us/op 1.00
Simple object binary -> struct 579.00 ns/op 630.00 ns/op 0.92
Simple object binary -> tree_backed 1.5920 us/op 1.7150 us/op 0.93
Simple object struct -> tree_backed 2.1990 us/op 2.3660 us/op 0.93
Simple object tree_backed -> struct 1.4730 us/op 1.6440 us/op 0.90
Simple object struct -> binary 886.00 ns/op 844.00 ns/op 1.05
Simple object tree_backed -> binary 1.2650 us/op 1.4500 us/op 0.87
aggregationBits binary -> struct 492.00 ns/op 529.00 ns/op 0.93
aggregationBits binary -> tree_backed 2.1630 us/op 2.3580 us/op 0.92
aggregationBits struct -> tree_backed 2.3920 us/op 2.8000 us/op 0.85
aggregationBits tree_backed -> struct 928.00 ns/op 1.1450 us/op 0.81
aggregationBits struct -> binary 682.00 ns/op 714.00 ns/op 0.96
aggregationBits tree_backed -> binary 832.00 ns/op 1.0020 us/op 0.83
List(uint8) 100000 binary -> struct 1.8902 ms/op 1.6701 ms/op 1.13
List(uint8) 100000 binary -> tree_backed 278.40 us/op 332.27 us/op 0.84
List(uint8) 100000 struct -> tree_backed 1.3897 ms/op 1.4486 ms/op 0.96
List(uint8) 100000 tree_backed -> struct 1.1626 ms/op 1.1655 ms/op 1.00
List(uint8) 100000 struct -> binary 1.0647 ms/op 1.1043 ms/op 0.96
List(uint8) 100000 tree_backed -> binary 110.63 us/op 116.90 us/op 0.95
List(uint64Number) 100000 binary -> struct 1.2844 ms/op 1.4853 ms/op 0.86
List(uint64Number) 100000 binary -> tree_backed 4.4696 ms/op 4.3282 ms/op 1.03
List(uint64Number) 100000 struct -> tree_backed 7.0928 ms/op 6.3714 ms/op 1.11
List(uint64Number) 100000 tree_backed -> struct 2.5548 ms/op 2.5111 ms/op 1.02
List(uint64Number) 100000 struct -> binary 1.4664 ms/op 1.4900 ms/op 0.98
List(uint64Number) 100000 tree_backed -> binary 1.0942 ms/op 1.0662 ms/op 1.03
List(Uint64Bigint) 100000 binary -> struct 3.9640 ms/op 3.5885 ms/op 1.10
List(Uint64Bigint) 100000 binary -> tree_backed 5.4528 ms/op 4.6292 ms/op 1.18
List(Uint64Bigint) 100000 struct -> tree_backed 6.6704 ms/op 7.5534 ms/op 0.88
List(Uint64Bigint) 100000 tree_backed -> struct 4.7764 ms/op 5.1846 ms/op 0.92
List(Uint64Bigint) 100000 struct -> binary 2.1036 ms/op 2.1297 ms/op 0.99
List(Uint64Bigint) 100000 tree_backed -> binary 1.0840 ms/op 1.2004 ms/op 0.90
Vector(Root) 100000 binary -> struct 37.231 ms/op 36.816 ms/op 1.01
Vector(Root) 100000 binary -> tree_backed 37.966 ms/op 39.641 ms/op 0.96
Vector(Root) 100000 struct -> tree_backed 54.649 ms/op 61.130 ms/op 0.89
Vector(Root) 100000 tree_backed -> struct 53.808 ms/op 53.966 ms/op 1.00
Vector(Root) 100000 struct -> binary 2.6781 ms/op 2.7011 ms/op 0.99
Vector(Root) 100000 tree_backed -> binary 6.0114 ms/op 6.0373 ms/op 1.00
List(Validator) 100000 binary -> struct 102.97 ms/op 100.68 ms/op 1.02
List(Validator) 100000 binary -> tree_backed 334.22 ms/op 363.39 ms/op 0.92
List(Validator) 100000 struct -> tree_backed 384.09 ms/op 390.94 ms/op 0.98
List(Validator) 100000 tree_backed -> struct 219.72 ms/op 221.04 ms/op 0.99
List(Validator) 100000 struct -> binary 29.677 ms/op 28.851 ms/op 1.03
List(Validator) 100000 tree_backed -> binary 112.29 ms/op 109.09 ms/op 1.03
List(Validator-NS) 100000 binary -> struct 113.94 ms/op 115.74 ms/op 0.98
List(Validator-NS) 100000 binary -> tree_backed 137.33 ms/op 160.89 ms/op 0.85
List(Validator-NS) 100000 struct -> tree_backed 208.86 ms/op 205.54 ms/op 1.02
List(Validator-NS) 100000 tree_backed -> struct 171.56 ms/op 168.29 ms/op 1.02
List(Validator-NS) 100000 struct -> binary 30.158 ms/op 28.961 ms/op 1.04
List(Validator-NS) 100000 tree_backed -> binary 34.250 ms/op 33.940 ms/op 1.01
get epochStatuses - MutableVector 102.69 us/op 103.74 us/op 0.99
get epochStatuses - ViewDU 212.43 us/op 214.19 us/op 0.99
set epochStatuses - ListTreeView 2.1330 ms/op 2.2634 ms/op 0.94
set epochStatuses - ListTreeView - set() 468.45 us/op 473.85 us/op 0.99
set epochStatuses - ListTreeView - commit() 746.22 us/op 786.23 us/op 0.95
bitstring 513.29 ns/op 513.46 ns/op 1.00
bit mask 13.616 ns/op 13.366 ns/op 1.02
struct - increase slot to 1000000 933.74 us/op 932.47 us/op 1.00
UintNumberType - increase slot to 1000000 28.390 ms/op 28.333 ms/op 1.00
UintBigintType - increase slot to 1000000 163.48 ms/op 165.85 ms/op 0.99
UintBigint8 x 100000 tree_deserialize 5.8012 ms/op 5.6074 ms/op 1.03
UintBigint8 x 100000 tree_serialize 1.1555 ms/op 1.1341 ms/op 1.02
UintBigint16 x 100000 tree_deserialize 5.4711 ms/op 6.5552 ms/op 0.83
UintBigint16 x 100000 tree_serialize 1.3525 ms/op 1.3684 ms/op 0.99
UintBigint32 x 100000 tree_deserialize 5.4894 ms/op 5.6964 ms/op 0.96
UintBigint32 x 100000 tree_serialize 1.6724 ms/op 1.8394 ms/op 0.91
UintBigint64 x 100000 tree_deserialize 6.7844 ms/op 6.4961 ms/op 1.04
UintBigint64 x 100000 tree_serialize 1.7173 ms/op 2.5310 ms/op 0.68
UintBigint8 x 100000 value_deserialize 437.65 us/op 435.63 us/op 1.00
UintBigint8 x 100000 value_serialize 754.31 us/op 765.89 us/op 0.98
UintBigint16 x 100000 value_deserialize 466.24 us/op 467.18 us/op 1.00
UintBigint16 x 100000 value_serialize 797.36 us/op 811.71 us/op 0.98
UintBigint32 x 100000 value_deserialize 497.93 us/op 498.38 us/op 1.00
UintBigint32 x 100000 value_serialize 839.45 us/op 840.44 us/op 1.00
UintBigint64 x 100000 value_deserialize 562.01 us/op 569.45 us/op 0.99
UintBigint64 x 100000 value_serialize 1.0363 ms/op 1.0384 ms/op 1.00
UintBigint8 x 100000 deserialize 3.2015 ms/op 3.1774 ms/op 1.01
UintBigint8 x 100000 serialize 1.5834 ms/op 1.6337 ms/op 0.97
UintBigint16 x 100000 deserialize 3.1611 ms/op 3.1588 ms/op 1.00
UintBigint16 x 100000 serialize 1.6463 ms/op 1.5303 ms/op 1.08
UintBigint32 x 100000 deserialize 3.2772 ms/op 3.2186 ms/op 1.02
UintBigint32 x 100000 serialize 2.9406 ms/op 2.8126 ms/op 1.05
UintBigint64 x 100000 deserialize 4.0923 ms/op 4.2677 ms/op 0.96
UintBigint64 x 100000 serialize 1.6268 ms/op 1.6403 ms/op 0.99
UintBigint128 x 100000 deserialize 6.0991 ms/op 5.8758 ms/op 1.04
UintBigint128 x 100000 serialize 15.240 ms/op 14.768 ms/op 1.03
UintBigint256 x 100000 deserialize 7.9852 ms/op 9.4738 ms/op 0.84
UintBigint256 x 100000 serialize 44.092 ms/op 43.153 ms/op 1.02
Slice from Uint8Array x25000 1.2974 ms/op 1.2839 ms/op 1.01
Slice from ArrayBuffer x25000 16.571 ms/op 16.348 ms/op 1.01
Slice from ArrayBuffer x25000 + new Uint8Array 17.359 ms/op 16.419 ms/op 1.06
Copy Uint8Array 100000 iterate 2.7976 ms/op 2.7738 ms/op 1.01
Copy Uint8Array 100000 slice 92.838 us/op 96.018 us/op 0.97
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 92.761 us/op 94.250 us/op 0.98
Copy Buffer 100000 Uint8Array.prototype.slice.call 93.153 us/op 95.908 us/op 0.97
Copy Uint8Array 100000 slice + set 189.78 us/op 190.59 us/op 1.00
Copy Uint8Array 100000 subarray + set 93.203 us/op 92.284 us/op 1.01
Copy Uint8Array 100000 slice arrayBuffer 92.356 us/op 95.399 us/op 0.97
Uint64 deserialize 100000 - iterate Uint8Array 1.8358 ms/op 1.8975 ms/op 0.97
Uint64 deserialize 100000 - by Uint32A 1.7620 ms/op 1.7809 ms/op 0.99
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.7930 ms/op 1.8517 ms/op 0.97
Uint64 deserialize 100000 - by DataView.getBigUint64 4.7542 ms/op 4.7695 ms/op 1.00
Uint64 deserialize 100000 - by byte 40.749 ms/op 40.752 ms/op 1.00

by benchmarkbot/action

@twoeths twoeths added this to the v1.1 milestone Mar 12, 2025
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wemeetagain wemeetagain merged commit 7ad418c into master Mar 12, 2025
11 checks passed
@wemeetagain wemeetagain deleted the te/for_each_apis branch March 12, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants