Skip to content

feat: allow array-like input for VectorCompositeType views#525

Merged
nflaig merged 1 commit intomasterfrom
nflaig/array-like-input-vector-composite
Apr 21, 2026
Merged

feat: allow array-like input for VectorCompositeType views#525
nflaig merged 1 commit intomasterfrom
nflaig/array-like-input-vector-composite

Conversation

@nflaig
Copy link
Copy Markdown
Member

@nflaig nflaig commented Apr 21, 2026

Continuation of #512, to apply the same change VectorCompositeType views

When the element is a VectorBasicType or ListBasicType, accept any ArrayLike (eg. Uint32Array) in place of number[].

@nflaig nflaig requested a review from a team as a code owner April 21, 2026 13:34
@github-actions github-actions Bot added the ssz label Apr 21, 2026
Copy link
Copy Markdown
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

@nflaig nflaig enabled auto-merge (squash) April 21, 2026 13:44
@nflaig nflaig merged commit 0feec86 into master Apr 21, 2026
10 checks passed
@nflaig nflaig deleted the nflaig/array-like-input-vector-composite branch April 21, 2026 13:46
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 54ead32 Previous: 5ae98cf Ratio
digestTwoHashObjects 50023 times 48.438 ms/op 49.736 ms/op 0.97
digest2Bytes32 50023 times 55.282 ms/op 55.983 ms/op 0.99
digest 50023 times 55.036 ms/op 54.969 ms/op 1.00
input length 32 1.2120 us/op 1.2630 us/op 0.96
input length 64 1.3820 us/op 1.4400 us/op 0.96
input length 128 2.2640 us/op 2.5070 us/op 0.90
input length 256 3.4110 us/op 3.6180 us/op 0.94
input length 512 5.5460 us/op 5.9770 us/op 0.93
input length 1024 10.737 us/op 11.117 us/op 0.97
digest 1000000 times 884.10 ms/op 865.72 ms/op 1.02
hashObjectToByteArray 50023 times 935.42 us/op 962.83 us/op 0.97
byteArrayToHashObject 50023 times 1.3186 ms/op 1.4818 ms/op 0.89
digest64 200092 times 218.14 ms/op 220.47 ms/op 0.99
hash 200092 times using batchHash4UintArray64s 235.71 ms/op 116.09 ms/op 2.03
digest64HashObjects 200092 times 193.10 ms/op 198.59 ms/op 0.97
hash 200092 times using batchHash4HashObjectInputs 201.42 ms/op 77.083 ms/op 2.61
getGindicesAtDepth 3.6110 us/op 3.7040 us/op 0.97
iterateAtDepth 6.4600 us/op 6.9330 us/op 0.93
getGindexBits 457.00 ns/op 500.00 ns/op 0.91
gindexIterator 909.00 ns/op 1.0490 us/op 0.87
HashComputationLevel.push then loop 26.421 ms/op 35.485 ms/op 0.74
HashComputation[] push then loop 37.628 ms/op 49.598 ms/op 0.76
hash 2 32 bytes Uint8Array 500000 times - hashtree 146.78 ms/op 142.89 ms/op 1.03
batch hash 16 x 64 Uint8Array 31250 times - hashtree 24.722 ms/op 38.036 ms/op 0.65
hashTwoObjects 500000 times - hashtree 167.03 ms/op 166.57 ms/op 1.00
executeHashComputations - hashtree 9.1109 ms/op 9.7263 ms/op 0.94
hash 2 32 bytes Uint8Array 500000 times - as-sha256 496.34 ms/op 498.80 ms/op 1.00
batch hash 16 x 64 Uint8Array 31250 times - as-sha256 514.50 ms/op 209.40 ms/op 2.46
hashTwoObjects 500000 times - as-sha256 506.34 ms/op 516.18 ms/op 0.98
executeHashComputations - as-sha256 44.116 ms/op 23.554 ms/op 1.87
hash 2 32 bytes Uint8Array 500000 times - noble 1.2310 s/op 1.2993 s/op 0.95
batch hash 16 x 64 Uint8Array 31250 times - noble 1.1949 s/op 1.2714 s/op 0.94
hashTwoObjects 500000 times - noble 1.5722 s/op 1.7775 s/op 0.88
executeHashComputations - noble 37.398 ms/op 37.235 ms/op 1.00
getHashComputations 2.3201 ms/op 1.8593 ms/op 1.25
executeHashComputations 10.171 ms/op 10.769 ms/op 0.94
get root 12.428 ms/op 12.763 ms/op 0.97
getNodeH() x7812.5 avg hindex 12.066 us/op 13.743 us/op 0.88
getNodeH() x7812.5 index 0 7.9060 us/op 7.1980 us/op 1.10
getNodeH() x7812.5 index 7 7.6130 us/op 7.0090 us/op 1.09
getNodeH() x7812.5 index 7 with key array 6.2730 us/op 7.8020 us/op 0.80
new LeafNode() x7812.5 307.38 us/op 325.67 us/op 0.94
getHashComputations 250000 nodes 15.135 ms/op 11.987 ms/op 1.26
batchHash 250000 nodes 83.701 ms/op 90.034 ms/op 0.93
get root 250000 nodes 93.019 ms/op 95.846 ms/op 0.97
getHashComputations 500000 nodes 28.078 ms/op 27.157 ms/op 1.03
batchHash 500000 nodes 148.68 ms/op 172.92 ms/op 0.86
get root 500000 nodes 192.98 ms/op 192.10 ms/op 1.00
getHashComputations 1000000 nodes 61.269 ms/op 45.220 ms/op 1.35
batchHash 1000000 nodes 344.62 ms/op 383.61 ms/op 0.90
get root 1000000 nodes 371.78 ms/op 396.34 ms/op 0.94
multiproof - depth 15, 1 requested leaves 7.9980 us/op 7.9970 us/op 1.00
tree offset multiproof - depth 15, 1 requested leaves 17.317 us/op 18.601 us/op 0.93
compact multiproof - depth 15, 1 requested leaves 3.6690 us/op 4.2390 us/op 0.87
multiproof - depth 15, 2 requested leaves 11.025 us/op 11.581 us/op 0.95
tree offset multiproof - depth 15, 2 requested leaves 21.137 us/op 22.412 us/op 0.94
compact multiproof - depth 15, 2 requested leaves 3.8900 us/op 4.0830 us/op 0.95
multiproof - depth 15, 3 requested leaves 15.914 us/op 15.613 us/op 1.02
tree offset multiproof - depth 15, 3 requested leaves 28.950 us/op 27.632 us/op 1.05
compact multiproof - depth 15, 3 requested leaves 4.9670 us/op 4.5400 us/op 1.09
multiproof - depth 15, 4 requested leaves 22.381 us/op 21.140 us/op 1.06
tree offset multiproof - depth 15, 4 requested leaves 37.100 us/op 34.201 us/op 1.08
compact multiproof - depth 15, 4 requested leaves 4.3040 us/op 4.6840 us/op 0.92
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.9030 us/op 6.0520 us/op 0.98
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.8180 us/op 6.1620 us/op 0.94
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.8330 us/op 6.3720 us/op 0.92
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.9630 us/op 6.4220 us/op 0.93
subtreeFillToContents depth 40 count 250000 49.701 ms/op 52.196 ms/op 0.95
setRoot - gindexBitstring 22.725 ms/op 20.458 ms/op 1.11
setRoot - gindex 22.401 ms/op 21.769 ms/op 1.03
getRoot - gindexBitstring 2.4627 ms/op 2.3266 ms/op 1.06
getRoot - gindex 3.1413 ms/op 3.1366 ms/op 1.00
getHashObject then setHashObject 21.984 ms/op 23.222 ms/op 0.95
setNodeWithFn 20.285 ms/op 21.146 ms/op 0.96
getNodeAtDepth depth 0 x100000 280.51 us/op 260.14 us/op 1.08
setNodeAtDepth depth 0 x100000 2.5916 ms/op 2.1262 ms/op 1.22
getNodesAtDepth depth 0 x100000 313.29 us/op 299.72 us/op 1.05
setNodesAtDepth depth 0 x100000 767.53 us/op 700.56 us/op 1.10
getNodeAtDepth depth 1 x100000 342.80 us/op 285.23 us/op 1.20
setNodeAtDepth depth 1 x100000 8.8553 ms/op 7.6284 ms/op 1.16
getNodesAtDepth depth 1 x100000 436.54 us/op 355.93 us/op 1.23
setNodesAtDepth depth 1 x100000 7.8143 ms/op 6.4855 ms/op 1.20
getNodeAtDepth depth 2 x100000 784.91 us/op 662.55 us/op 1.18
setNodeAtDepth depth 2 x100000 18.506 ms/op 14.281 ms/op 1.30
getNodesAtDepth depth 2 x100000 18.615 ms/op 17.876 ms/op 1.04
setNodesAtDepth depth 2 x100000 26.165 ms/op 21.735 ms/op 1.20
tree.getNodesAtDepth - gindexes 11.310 ms/op 8.0145 ms/op 1.41
tree.getNodesAtDepth - push all nodes 2.4489 ms/op 1.9378 ms/op 1.26
tree.getNodesAtDepth - navigation 312.25 us/op 288.54 us/op 1.08
tree.setNodesAtDepth - indexes 785.11 us/op 748.96 us/op 1.05
set at depth 8 932.00 ns/op 1.0380 us/op 0.90
set at depth 16 1.3000 us/op 1.2330 us/op 1.05
set at depth 32 2.1920 us/op 2.3350 us/op 0.94
iterateNodesAtDepth 8 256 16.100 us/op 14.213 us/op 1.13
getNodesAtDepth 8 256 4.0390 us/op 3.6740 us/op 1.10
iterateNodesAtDepth 16 65536 4.9738 ms/op 4.2240 ms/op 1.18
getNodesAtDepth 16 65536 1.6197 ms/op 1.0384 ms/op 1.56
iterateNodesAtDepth 32 250000 16.226 ms/op 15.601 ms/op 1.04
getNodesAtDepth 32 250000 4.7748 ms/op 4.5101 ms/op 1.06
iterateNodesAtDepth 40 250000 16.247 ms/op 15.633 ms/op 1.04
getNodesAtDepth 40 250000 4.5946 ms/op 4.5695 ms/op 1.01
250000 validators root getter 95.211 ms/op 97.128 ms/op 0.98
250000 validators batchHash() 113.24 ms/op 98.068 ms/op 1.15
250000 validators hashComputations 16.159 ms/op 11.923 ms/op 1.36
bitlist bytes to struct (120,90) 514.00 ns/op 614.00 ns/op 0.84
bitlist bytes to tree (120,90) 2.4510 us/op 2.5310 us/op 0.97
bitlist bytes to struct (2048,2048) 968.00 ns/op 1.2010 us/op 0.81
bitlist bytes to tree (2048,2048) 3.6540 us/op 4.5690 us/op 0.80
ByteListType - deserialize 10.219 ms/op 13.862 ms/op 0.74
BasicListType - deserialize 10.221 ms/op 10.235 ms/op 1.00
ByteListType - serialize 9.7521 ms/op 12.984 ms/op 0.75
BasicListType - serialize 11.127 ms/op 15.076 ms/op 0.74
BasicListType - tree_convertToStruct 24.202 ms/op 23.689 ms/op 1.02
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.1353 ms/op 3.8383 ms/op 1.34
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.4008 ms/op 3.4704 ms/op 1.27
Array.push len 300000 empty Array - number 7.2594 ms/op 6.0675 ms/op 1.20
Array.set len 300000 from new Array - number 2.0358 ms/op 1.8054 ms/op 1.13
Array.set len 300000 - number 6.7689 ms/op 5.3278 ms/op 1.27
Uint8Array.set len 300000 401.98 us/op 295.88 us/op 1.36
Uint32Array.set len 300000 514.92 us/op 380.51 us/op 1.35
Container({a: uint8, b: uint8}) getViewDU x300000 31.495 ms/op 33.115 ms/op 0.95
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 12.045 ms/op 10.815 ms/op 1.11
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 221.83 ms/op 223.45 ms/op 0.99
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 235.93 ms/op 295.11 ms/op 0.80
List(Container) len 300000 ViewDU.get(i) 6.9316 ms/op 7.8977 ms/op 0.88
List(Container) len 300000 ViewDU.getReadonly(i) 6.8597 ms/op 8.0632 ms/op 0.85
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 36.702 ms/op 38.936 ms/op 0.94
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.1465 ms/op 6.0089 ms/op 0.86
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.2330 ms/op 7.0736 ms/op 0.88
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.2779 ms/op 7.0634 ms/op 0.89
Array.push len 300000 empty Array - object 6.5987 ms/op 5.7786 ms/op 1.14
Array.set len 300000 from new Array - object 1.9724 ms/op 2.3858 ms/op 0.83
Array.set len 300000 - object 6.0756 ms/op 6.1715 ms/op 0.98
cachePermanentRootStruct no cache 3.1300 us/op 3.5780 us/op 0.87
cachePermanentRootStruct with cache 177.00 ns/op 242.00 ns/op 0.73
epochParticipation len 250000 rws 7813 2.3230 ms/op 2.5301 ms/op 0.92
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 4.7377 ms/op 5.1018 ms/op 0.93
BeaconState ViewDU batchHashTreeRoot vc=200000 mod=100000 211.03 ms/op 252.15 ms/op 0.84
BeaconState ViewDU batchHashTreeRoot - commit step vc=200000 mod=100000 184.41 ms/op 209.94 ms/op 0.88
BeaconState ViewDU batchHashTreeRoot - hash step vc=200000 mod=100000 48.261 ms/op 52.386 ms/op 0.92
BeaconState ViewDU hashTreeRoot() vc=200000 mod=100000 692.89 ms/op 711.65 ms/op 0.97
BeaconState ViewDU hashTreeRoot - commit step vc=200000 mod=100000 68.005 ms/op 62.800 ms/op 1.08
BeaconState ViewDU hashTreeRoot - validator tree creation vc=100000 mod=100000 263.87 ms/op 292.74 ms/op 0.90
deserialize Attestation - tree 3.8270 us/op 4.0050 us/op 0.96
deserialize Attestation - struct 1.9720 us/op 2.1690 us/op 0.91
deserialize Attestation - struct (reuse bytes) 1.5020 us/op 1.5660 us/op 0.96
deserialize SignedAggregateAndProof - tree 4.9030 us/op 5.3610 us/op 0.91
deserialize SignedAggregateAndProof - struct 3.0740 us/op 3.8580 us/op 0.80
deserialize SignedAggregateAndProof - struct (reuse bytes) 1.9380 us/op 2.0070 us/op 0.97
deserialize SyncCommitteeMessage - tree 1.4040 us/op 1.6220 us/op 0.87
deserialize SyncCommitteeMessage - struct 1.0710 us/op 1.2880 us/op 0.83
deserialize SyncCommitteeMessage - struct (reuse bytes) 732.00 ns/op 861.00 ns/op 0.85
deserialize SignedContributionAndProof - tree 2.9240 us/op 3.1440 us/op 0.93
deserialize SignedContributionAndProof - struct 2.3820 us/op 2.9890 us/op 0.80
deserialize SignedContributionAndProof - struct (reuse bytes) 1.2590 us/op 1.4220 us/op 0.89
deserialize SignedBeaconBlock - tree 276.10 us/op 308.33 us/op 0.90
deserialize SignedBeaconBlock - struct 123.78 us/op 147.67 us/op 0.84
deserialize SignedBeaconBlock - struct (reuse bytes) 78.587 us/op 81.245 us/op 0.97
BeaconState vc 300000 - deserialize tree 648.57 ms/op 675.60 ms/op 0.96
BeaconState vc 300000 - serialize tree 98.166 ms/op 102.63 ms/op 0.96
BeaconState.historicalRoots vc 300000 - deserialize tree 890.00 ns/op 1.0340 us/op 0.86
BeaconState.historicalRoots vc 300000 - serialize tree 679.00 ns/op 880.00 ns/op 0.77
BeaconState.validators vc 300000 - deserialize tree 596.31 ms/op 618.97 ms/op 0.96
BeaconState.validators vc 300000 - serialize tree 31.915 ms/op 35.972 ms/op 0.89
BeaconState.balances vc 300000 - deserialize tree 28.373 ms/op 30.370 ms/op 0.93
BeaconState.balances vc 300000 - serialize tree 3.8056 ms/op 4.0935 ms/op 0.93
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 908.78 us/op 1.0329 ms/op 0.88
BeaconState.previousEpochParticipation vc 300000 - serialize tree 322.63 us/op 370.43 us/op 0.87
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 903.72 us/op 986.09 us/op 0.92
BeaconState.currentEpochParticipation vc 300000 - serialize tree 322.97 us/op 373.18 us/op 0.87
BeaconState.inactivityScores vc 300000 - deserialize tree 27.793 ms/op 29.222 ms/op 0.95
BeaconState.inactivityScores vc 300000 - serialize tree 3.8148 ms/op 4.1631 ms/op 0.92
hashTreeRoot Attestation - struct 9.5100 us/op 11.010 us/op 0.86
hashTreeRoot Attestation - tree 7.3740 us/op 7.6490 us/op 0.96
hashTreeRoot SignedAggregateAndProof - struct 12.313 us/op 13.117 us/op 0.94
hashTreeRoot SignedAggregateAndProof - tree 10.941 us/op 11.131 us/op 0.98
hashTreeRoot SyncCommitteeMessage - struct 3.0780 us/op 3.4720 us/op 0.89
hashTreeRoot SyncCommitteeMessage - tree 2.7310 us/op 3.0380 us/op 0.90
hashTreeRoot SignedContributionAndProof - struct 7.6380 us/op 8.4770 us/op 0.90
hashTreeRoot SignedContributionAndProof - tree 7.6040 us/op 7.8440 us/op 0.97
hashTreeRoot SignedBeaconBlock - struct 771.65 us/op 784.13 us/op 0.98
hashTreeRoot SignedBeaconBlock - tree 657.34 us/op 654.18 us/op 1.00
hashTreeRoot Validator - struct 4.4420 us/op 4.8150 us/op 0.92
hashTreeRoot Validator - tree 5.7190 us/op 6.5300 us/op 0.88
BeaconState vc 300000 - hashTreeRoot tree 1.9960 s/op 2.1247 s/op 0.94
BeaconState vc 300000 - batchHashTreeRoot tree 3.9805 s/op 4.1649 s/op 0.96
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 849.00 ns/op 835.00 ns/op 1.02
BeaconState.validators vc 300000 - hashTreeRoot tree 2.1174 s/op 2.3495 s/op 0.90
BeaconState.balances vc 300000 - hashTreeRoot tree 28.168 ms/op 28.089 ms/op 1.00
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 3.4191 ms/op 3.4962 ms/op 0.98
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 3.4726 ms/op 3.4931 ms/op 0.99
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 30.895 ms/op 28.163 ms/op 1.10
hash64 x18 9.0290 us/op 8.0730 us/op 1.12
hashTwoObjects x18 6.3440 us/op 7.2730 us/op 0.87
hash64 x1740 679.33 us/op 652.23 us/op 1.04
hashTwoObjects x1740 580.60 us/op 597.46 us/op 0.97
hash64 x2700000 1.0916 s/op 1.0102 s/op 1.08
hashTwoObjects x2700000 909.49 ms/op 924.46 ms/op 0.98
get_exitEpoch - ContainerType 289.00 ns/op 261.00 ns/op 1.11
get_exitEpoch - ContainerNodeStructType 332.00 ns/op 282.00 ns/op 1.18
set_exitEpoch - ContainerType 267.00 ns/op 290.00 ns/op 0.92
set_exitEpoch - ContainerNodeStructType 249.00 ns/op 297.00 ns/op 0.84
get_pubkey - ContainerType 933.00 ns/op 1.3600 us/op 0.69
get_pubkey - ContainerNodeStructType 231.00 ns/op 268.00 ns/op 0.86
hashTreeRoot - ContainerType 494.00 ns/op 533.00 ns/op 0.93
hashTreeRoot - ContainerNodeStructType 478.00 ns/op 475.00 ns/op 1.01
createProof - ContainerType 3.7350 us/op 4.3990 us/op 0.85
createProof - ContainerNodeStructType 20.558 us/op 21.552 us/op 0.95
serialize - ContainerType 1.8470 us/op 2.0090 us/op 0.92
serialize - ContainerNodeStructType 1.2070 us/op 1.3950 us/op 0.87
set_exitEpoch_and_hashTreeRoot - ContainerType 2.6750 us/op 2.7590 us/op 0.97
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 6.8460 us/op 7.3360 us/op 0.93
doBatchHashTreeRootValidators 3.6080 us/op 4.6790 us/op 0.77
ContainerNodeStructViewDU hashTreeRoot 22.863 us/op 24.479 us/op 0.93
Array - for of 5.8140 us/op 8.9780 us/op 0.65
Array - for(;;) 5.7150 us/op 8.3880 us/op 0.68
basicListValue.readonlyValuesArray() 4.2649 ms/op 4.4815 ms/op 0.95
basicListValue.readonlyValuesArray() + loop all 4.7953 ms/op 4.6079 ms/op 1.04
compositeListValue.readonlyValuesArray() 30.730 ms/op 27.196 ms/op 1.13
compositeListValue.readonlyValuesArray() + loop all 30.137 ms/op 33.904 ms/op 0.89
Number64UintType - get balances list 5.0215 ms/op 5.1284 ms/op 0.98
Number64UintType - set balances list 9.3723 ms/op 9.2849 ms/op 1.01
Number64UintType - get and increase 10 then set 43.254 ms/op 44.026 ms/op 0.98
Number64UintType - increase 10 using applyDelta 16.895 ms/op 16.096 ms/op 1.05
Number64UintType - increase 10 using applyDeltaInBatch 17.038 ms/op 15.760 ms/op 1.08
tree_newTreeFromUint64Deltas 22.467 ms/op 19.708 ms/op 1.14
unsafeUint8ArrayToTree 38.037 ms/op 39.999 ms/op 0.95
bitLength(50) 263.00 ns/op 278.00 ns/op 0.95
bitLengthStr(50) 232.00 ns/op 219.00 ns/op 1.06
bitLength(8000) 246.00 ns/op 262.00 ns/op 0.94
bitLengthStr(8000) 296.00 ns/op 302.00 ns/op 0.98
bitLength(250000) 275.00 ns/op 266.00 ns/op 1.03
bitLengthStr(250000) 346.00 ns/op 309.00 ns/op 1.12
merkleize 32 chunks 13.189 us/op 12.883 us/op 1.02
merkleizeBlocksBytes 32 chunks 3.0780 us/op 4.0960 us/op 0.75
merkleizeBlockArray 32 chunks 6.1860 us/op 7.1510 us/op 0.87
merkleize 128 chunks 52.136 us/op 48.826 us/op 1.07
merkleizeBlocksBytes 128 chunks 7.2810 us/op 10.966 us/op 0.66
merkleizeBlockArray 128 chunks 17.649 us/op 21.092 us/op 0.84
merkleize 512 chunks 205.22 us/op 194.60 us/op 1.05
merkleizeBlocksBytes 512 chunks 22.736 us/op 36.615 us/op 0.62
merkleizeBlockArray 512 chunks 60.700 us/op 72.995 us/op 0.83
merkleize 1024 chunks 414.46 us/op 390.41 us/op 1.06
merkleizeBlocksBytes 1024 chunks 42.628 us/op 70.660 us/op 0.60
merkleizeBlockArray 1024 chunks 117.64 us/op 143.00 us/op 0.82
floor - Math.floor (53) 1.2461 ns/op 1.1527 ns/op 1.08
floor - << 0 (53) 1.2451 ns/op 1.1535 ns/op 1.08
floor - Math.floor (512) 1.2456 ns/op 1.1537 ns/op 1.08
floor - << 0 (512) 1.2448 ns/op 1.1520 ns/op 1.08
fnIf(0) 1.5568 ns/op 1.4416 ns/op 1.08
fnSwitch(0) 2.1805 ns/op 2.1827 ns/op 1.00
fnObj(0) 1.5633 ns/op 1.8784 ns/op 0.83
fnArr(0) 1.5572 ns/op 1.8722 ns/op 0.83
fnIf(4) 2.1800 ns/op 2.2956 ns/op 0.95
fnSwitch(4) 2.1803 ns/op 2.1863 ns/op 1.00
fnObj(4) 1.5634 ns/op 1.8727 ns/op 0.83
fnArr(4) 1.5591 ns/op 1.8767 ns/op 0.83
fnIf(9) 3.1123 ns/op 3.7538 ns/op 0.83
fnSwitch(9) 2.1807 ns/op 2.1913 ns/op 1.00
fnObj(9) 1.5653 ns/op 1.8726 ns/op 0.84
fnArr(9) 1.5579 ns/op 1.8715 ns/op 0.83
Container {a,b,vec} - as struct x100000 124.72 us/op 129.84 us/op 0.96
Container {a,b,vec} - as tree x100000 560.61 us/op 516.40 us/op 1.09
Container {a,vec,b} - as struct x100000 155.83 us/op 144.42 us/op 1.08
Container {a,vec,b} - as tree x100000 560.73 us/op 577.91 us/op 0.97
get 2 props x1000000 - rawObject 315.96 us/op 288.13 us/op 1.10
get 2 props x1000000 - proxy 72.626 ms/op 63.546 ms/op 1.14
get 2 props x1000000 - customObj 312.15 us/op 288.59 us/op 1.08
Simple object binary -> struct 620.00 ns/op 663.00 ns/op 0.94
Simple object binary -> tree_backed 1.7810 us/op 1.9640 us/op 0.91
Simple object struct -> tree_backed 2.2950 us/op 2.7760 us/op 0.83
Simple object tree_backed -> struct 1.6620 us/op 1.8560 us/op 0.90
Simple object struct -> binary 939.00 ns/op 1.1710 us/op 0.80
Simple object tree_backed -> binary 1.2890 us/op 1.5360 us/op 0.84
aggregationBits binary -> struct 504.00 ns/op 557.00 ns/op 0.90
aggregationBits binary -> tree_backed 2.3620 us/op 2.6460 us/op 0.89
aggregationBits struct -> tree_backed 2.8190 us/op 3.2030 us/op 0.88
aggregationBits tree_backed -> struct 1.0280 us/op 1.3460 us/op 0.76
aggregationBits struct -> binary 743.00 ns/op 1.0260 us/op 0.72
aggregationBits tree_backed -> binary 894.00 ns/op 1.0940 us/op 0.82
List(uint8) 100000 binary -> struct 916.61 us/op 902.71 us/op 1.02
List(uint8) 100000 binary -> tree_backed 287.00 us/op 310.65 us/op 0.92
List(uint8) 100000 struct -> tree_backed 1.3770 ms/op 1.2862 ms/op 1.07
List(uint8) 100000 tree_backed -> struct 955.42 us/op 889.31 us/op 1.07
List(uint8) 100000 struct -> binary 1.0656 ms/op 956.18 us/op 1.11
List(uint8) 100000 tree_backed -> binary 108.91 us/op 100.04 us/op 1.09
List(uint64Number) 100000 binary -> struct 1.3723 ms/op 1.2977 ms/op 1.06
List(uint64Number) 100000 binary -> tree_backed 4.6816 ms/op 4.5945 ms/op 1.02
List(uint64Number) 100000 struct -> tree_backed 6.9927 ms/op 6.3281 ms/op 1.11
List(uint64Number) 100000 tree_backed -> struct 2.5129 ms/op 2.2883 ms/op 1.10
List(uint64Number) 100000 struct -> binary 1.4816 ms/op 1.3838 ms/op 1.07
List(uint64Number) 100000 tree_backed -> binary 1.5062 ms/op 1.1643 ms/op 1.29
List(Uint64Bigint) 100000 binary -> struct 4.0707 ms/op 3.8313 ms/op 1.06
List(Uint64Bigint) 100000 binary -> tree_backed 5.2913 ms/op 4.7061 ms/op 1.12
List(Uint64Bigint) 100000 struct -> tree_backed 7.5344 ms/op 7.1681 ms/op 1.05
List(Uint64Bigint) 100000 tree_backed -> struct 5.3547 ms/op 4.7656 ms/op 1.12
List(Uint64Bigint) 100000 struct -> binary 2.1275 ms/op 1.8372 ms/op 1.16
List(Uint64Bigint) 100000 tree_backed -> binary 1.4772 ms/op 1.3806 ms/op 1.07
Vector(Root) 100000 binary -> struct 37.262 ms/op 37.171 ms/op 1.00
Vector(Root) 100000 binary -> tree_backed 35.573 ms/op 35.837 ms/op 0.99
Vector(Root) 100000 struct -> tree_backed 50.645 ms/op 54.295 ms/op 0.93
Vector(Root) 100000 tree_backed -> struct 49.043 ms/op 53.558 ms/op 0.92
Vector(Root) 100000 struct -> binary 3.1327 ms/op 2.9316 ms/op 1.07
Vector(Root) 100000 tree_backed -> binary 7.5534 ms/op 6.8305 ms/op 1.11
List(Validator) 100000 binary -> struct 117.88 ms/op 118.23 ms/op 1.00
List(Validator) 100000 binary -> tree_backed 365.54 ms/op 363.99 ms/op 1.00
List(Validator) 100000 struct -> tree_backed 386.07 ms/op 390.63 ms/op 0.99
List(Validator) 100000 tree_backed -> struct 217.73 ms/op 216.65 ms/op 1.00
List(Validator) 100000 struct -> binary 29.959 ms/op 28.171 ms/op 1.06
List(Validator) 100000 tree_backed -> binary 108.73 ms/op 98.563 ms/op 1.10
List(Validator-NS) 100000 binary -> struct 118.84 ms/op 117.93 ms/op 1.01
List(Validator-NS) 100000 binary -> tree_backed 167.87 ms/op 158.68 ms/op 1.06
List(Validator-NS) 100000 struct -> tree_backed 189.11 ms/op 192.51 ms/op 0.98
List(Validator-NS) 100000 tree_backed -> struct 153.23 ms/op 165.88 ms/op 0.92
List(Validator-NS) 100000 struct -> binary 7.3789 ms/op 8.2253 ms/op 0.90
List(Validator-NS) 100000 tree_backed -> binary 13.901 ms/op 14.123 ms/op 0.98
get epochStatuses - MutableVector 87.094 us/op 83.292 us/op 1.05
get epochStatuses - ViewDU 207.82 us/op 220.55 us/op 0.94
set epochStatuses - ListTreeView 2.2268 ms/op 2.2071 ms/op 1.01
set epochStatuses - ListTreeView - set() 444.59 us/op 506.81 us/op 0.88
set epochStatuses - ListTreeView - commit() 794.62 us/op 789.97 us/op 1.01
bitstring 517.27 ns/op 529.11 ns/op 0.98
bit mask 14.121 ns/op 10.392 ns/op 1.36
struct - increase slot to 1000000 934.89 us/op 2.5401 ms/op 0.37
UintNumberType - increase slot to 1000000 25.283 ms/op 26.467 ms/op 0.96
UintBigintType - increase slot to 1000000 179.45 ms/op 173.61 ms/op 1.03
UintBigint8 x 100000 tree_deserialize 5.7318 ms/op 5.5391 ms/op 1.03
UintBigint8 x 100000 tree_serialize 1.1289 ms/op 1.0141 ms/op 1.11
UintBigint16 x 100000 tree_deserialize 5.6547 ms/op 5.4551 ms/op 1.04
UintBigint16 x 100000 tree_serialize 1.3656 ms/op 1.2636 ms/op 1.08
UintBigint32 x 100000 tree_deserialize 5.4824 ms/op 5.7444 ms/op 0.95
UintBigint32 x 100000 tree_serialize 1.8317 ms/op 1.7573 ms/op 1.04
UintBigint64 x 100000 tree_deserialize 5.9665 ms/op 6.0533 ms/op 0.99
UintBigint64 x 100000 tree_serialize 2.5177 ms/op 2.5070 ms/op 1.00
UintBigint8 x 100000 value_deserialize 405.40 us/op 374.74 us/op 1.08
UintBigint8 x 100000 value_serialize 819.48 us/op 906.03 us/op 0.90
UintBigint16 x 100000 value_deserialize 467.63 us/op 406.14 us/op 1.15
UintBigint16 x 100000 value_serialize 816.69 us/op 930.20 us/op 0.88
UintBigint32 x 100000 value_deserialize 498.28 us/op 455.57 us/op 1.09
UintBigint32 x 100000 value_serialize 825.90 us/op 950.23 us/op 0.87
UintBigint64 x 100000 value_deserialize 532.03 us/op 518.39 us/op 1.03
UintBigint64 x 100000 value_serialize 972.37 us/op 1.1013 ms/op 0.88
UintBigint8 x 100000 deserialize 3.3142 ms/op 3.4848 ms/op 0.95
UintBigint8 x 100000 serialize 1.5206 ms/op 1.4748 ms/op 1.03
UintBigint16 x 100000 deserialize 3.4198 ms/op 3.5019 ms/op 0.98
UintBigint16 x 100000 serialize 1.5686 ms/op 1.5666 ms/op 1.00
UintBigint32 x 100000 deserialize 3.1920 ms/op 3.5890 ms/op 0.89
UintBigint32 x 100000 serialize 2.9464 ms/op 3.0659 ms/op 0.96
UintBigint64 x 100000 deserialize 4.0646 ms/op 4.2459 ms/op 0.96
UintBigint64 x 100000 serialize 1.6570 ms/op 1.4948 ms/op 1.11
UintBigint128 x 100000 deserialize 5.7449 ms/op 5.5355 ms/op 1.04
UintBigint128 x 100000 serialize 15.032 ms/op 14.766 ms/op 1.02
UintBigint256 x 100000 deserialize 8.7211 ms/op 8.3598 ms/op 1.04
UintBigint256 x 100000 serialize 45.871 ms/op 41.806 ms/op 1.10
Slice from Uint8Array x25000 1.5430 ms/op 1.5005 ms/op 1.03
Slice from ArrayBuffer x25000 16.541 ms/op 20.855 ms/op 0.79
Slice from ArrayBuffer x25000 + new Uint8Array 17.768 ms/op 23.545 ms/op 0.75
Copy Uint8Array 100000 iterate 1.6723 ms/op 1.5766 ms/op 1.06
Copy Uint8Array 100000 slice 107.55 us/op 106.71 us/op 1.01
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 107.49 us/op 104.25 us/op 1.03
Copy Buffer 100000 Uint8Array.prototype.slice.call 108.76 us/op 104.62 us/op 1.04
Copy Uint8Array 100000 slice + set 204.16 us/op 238.03 us/op 0.86
Copy Uint8Array 100000 subarray + set 98.523 us/op 112.75 us/op 0.87
Copy Uint8Array 100000 slice arrayBuffer 100.86 us/op 107.75 us/op 0.94
Uint64 deserialize 100000 - iterate Uint8Array 1.9869 ms/op 1.6990 ms/op 1.17
Uint64 deserialize 100000 - by Uint32A 1.9281 ms/op 1.6797 ms/op 1.15
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.9818 ms/op 1.7152 ms/op 1.16
Uint64 deserialize 100000 - by DataView.getBigUint64 4.9896 ms/op 4.8959 ms/op 1.02
Uint64 deserialize 100000 - by byte 40.545 ms/op 50.895 ms/op 0.80

by benchmarkbot/action

nflaig pushed a commit that referenced this pull request Apr 21, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>ssz: 1.4.0</summary>

##
[1.4.0](ssz-v1.3.4...ssz-v1.4.0)
(2026-04-21)


### Features

* allow array-like input for VectorCompositeType views
([#525](#525))
([0feec86](0feec86))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants