Skip to content

fix: allow array-like input for VectorBasicType views#512

Merged
wemeetagain merged 4 commits intomasterfrom
nflaig/array-like
Mar 17, 2026
Merged

fix: allow array-like input for VectorBasicType views#512
wemeetagain merged 4 commits intomasterfrom
nflaig/array-like

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Mar 17, 2026

This allows to pass Uint32Array as value

@nflaig nflaig requested a review from a team as a code owner March 17, 2026 09:24
@github-actions github-actions bot added the ssz label Mar 17, 2026
@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 21bd764 Previous: 3956039 Ratio
digestTwoHashObjects 50023 times 48.062 ms/op 48.224 ms/op 1.00
digest2Bytes32 50023 times 55.028 ms/op 54.633 ms/op 1.01
digest 50023 times 53.542 ms/op 53.374 ms/op 1.00
input length 32 1.2180 us/op 1.1960 us/op 1.02
input length 64 1.3850 us/op 1.3740 us/op 1.01
input length 128 2.3330 us/op 2.2950 us/op 1.02
input length 256 3.4920 us/op 3.4240 us/op 1.02
input length 512 5.6780 us/op 5.6650 us/op 1.00
input length 1024 10.768 us/op 10.624 us/op 1.01
digest 1000000 times 865.25 ms/op 849.93 ms/op 1.02
hashObjectToByteArray 50023 times 939.22 us/op 934.17 us/op 1.01
byteArrayToHashObject 50023 times 1.3281 ms/op 1.3232 ms/op 1.00
digest64 200092 times 216.44 ms/op 214.01 ms/op 1.01
hash 200092 times using batchHash4UintArray64s 237.77 ms/op 246.69 ms/op 0.96
digest64HashObjects 200092 times 191.42 ms/op 190.61 ms/op 1.00
hash 200092 times using batchHash4HashObjectInputs 198.12 ms/op 203.17 ms/op 0.98
getGindicesAtDepth 3.6520 us/op 3.6640 us/op 1.00
iterateAtDepth 6.8390 us/op 6.4010 us/op 1.07
getGindexBits 481.00 ns/op 420.00 ns/op 1.15
gindexIterator 950.00 ns/op 892.00 ns/op 1.07
HashComputationLevel.push then loop 28.698 ms/op 27.077 ms/op 1.06
HashComputation[] push then loop 50.138 ms/op 48.799 ms/op 1.03
hash 2 32 bytes Uint8Array 500000 times - hashtree 150.11 ms/op 149.02 ms/op 1.01
batch hash 16 x 64 Uint8Array 31250 times - hashtree 24.711 ms/op 24.407 ms/op 1.01
hashTwoObjects 500000 times - hashtree 171.80 ms/op 173.68 ms/op 0.99
executeHashComputations - hashtree 9.6090 ms/op 9.2646 ms/op 1.04
hash 2 32 bytes Uint8Array 500000 times - as-sha256 498.05 ms/op 491.07 ms/op 1.01
batch hash 16 x 64 Uint8Array 31250 times - as-sha256 544.47 ms/op 524.96 ms/op 1.04
hashTwoObjects 500000 times - as-sha256 511.84 ms/op 504.58 ms/op 1.01
executeHashComputations - as-sha256 46.123 ms/op 47.996 ms/op 0.96
hash 2 32 bytes Uint8Array 500000 times - noble 1.2982 s/op 1.2656 s/op 1.03
batch hash 16 x 64 Uint8Array 31250 times - noble 1.2357 s/op 1.2312 s/op 1.00
hashTwoObjects 500000 times - noble 1.5989 s/op 1.5855 s/op 1.01
executeHashComputations - noble 36.602 ms/op 36.723 ms/op 1.00
getHashComputations 2.5625 ms/op 2.1703 ms/op 1.18
executeHashComputations 11.030 ms/op 9.9428 ms/op 1.11
get root 13.029 ms/op 12.669 ms/op 1.03
getNodeH() x7812.5 avg hindex 12.185 us/op 12.046 us/op 1.01
getNodeH() x7812.5 index 0 7.6500 us/op 7.8090 us/op 0.98
getNodeH() x7812.5 index 7 7.8520 us/op 7.5360 us/op 1.04
getNodeH() x7812.5 index 7 with key array 6.2580 us/op 6.2530 us/op 1.00
new LeafNode() x7812.5 300.85 us/op 307.10 us/op 0.98
getHashComputations 250000 nodes 16.045 ms/op 15.054 ms/op 1.07
batchHash 250000 nodes 82.948 ms/op 84.933 ms/op 0.98
get root 250000 nodes 101.71 ms/op 96.158 ms/op 1.06
getHashComputations 500000 nodes 32.924 ms/op 28.722 ms/op 1.15
batchHash 500000 nodes 154.32 ms/op 150.14 ms/op 1.03
get root 500000 nodes 199.86 ms/op 197.40 ms/op 1.01
getHashComputations 1000000 nodes 70.521 ms/op 58.971 ms/op 1.20
batchHash 1000000 nodes 356.39 ms/op 331.82 ms/op 1.07
get root 1000000 nodes 395.65 ms/op 379.56 ms/op 1.04
multiproof - depth 15, 1 requested leaves 8.4610 us/op 7.6610 us/op 1.10
tree offset multiproof - depth 15, 1 requested leaves 17.908 us/op 17.325 us/op 1.03
compact multiproof - depth 15, 1 requested leaves 3.7340 us/op 3.3030 us/op 1.13
multiproof - depth 15, 2 requested leaves 11.220 us/op 11.409 us/op 0.98
tree offset multiproof - depth 15, 2 requested leaves 21.690 us/op 21.165 us/op 1.02
compact multiproof - depth 15, 2 requested leaves 3.8790 us/op 3.3280 us/op 1.17
multiproof - depth 15, 3 requested leaves 17.042 us/op 15.748 us/op 1.08
tree offset multiproof - depth 15, 3 requested leaves 27.200 us/op 26.794 us/op 1.02
compact multiproof - depth 15, 3 requested leaves 3.8190 us/op 3.6300 us/op 1.05
multiproof - depth 15, 4 requested leaves 22.525 us/op 20.728 us/op 1.09
tree offset multiproof - depth 15, 4 requested leaves 36.548 us/op 32.671 us/op 1.12
compact multiproof - depth 15, 4 requested leaves 4.4900 us/op 3.8410 us/op 1.17
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.7470 us/op 5.8440 us/op 0.98
packedRootsBytesToLeafNodes bytes 4000 offset 1 6.3750 us/op 5.7270 us/op 1.11
packedRootsBytesToLeafNodes bytes 4000 offset 2 6.0560 us/op 5.6550 us/op 1.07
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.8760 us/op 5.6360 us/op 1.04
subtreeFillToContents depth 40 count 250000 50.778 ms/op 48.011 ms/op 1.06
setRoot - gindexBitstring 22.329 ms/op 21.407 ms/op 1.04
setRoot - gindex 23.195 ms/op 22.659 ms/op 1.02
getRoot - gindexBitstring 2.6460 ms/op 2.5091 ms/op 1.05
getRoot - gindex 3.3858 ms/op 3.0661 ms/op 1.10
getHashObject then setHashObject 24.085 ms/op 22.371 ms/op 1.08
setNodeWithFn 21.011 ms/op 20.451 ms/op 1.03
getNodeAtDepth depth 0 x100000 280.06 us/op 280.13 us/op 1.00
setNodeAtDepth depth 0 x100000 2.6449 ms/op 2.6597 ms/op 0.99
getNodesAtDepth depth 0 x100000 312.99 us/op 313.04 us/op 1.00
setNodesAtDepth depth 0 x100000 786.30 us/op 762.22 us/op 1.03
getNodeAtDepth depth 1 x100000 343.12 us/op 342.09 us/op 1.00
setNodeAtDepth depth 1 x100000 9.1757 ms/op 8.3612 ms/op 1.10
getNodesAtDepth depth 1 x100000 436.25 us/op 435.90 us/op 1.00
setNodesAtDepth depth 1 x100000 7.4353 ms/op 7.6943 ms/op 0.97
getNodeAtDepth depth 2 x100000 847.76 us/op 825.13 us/op 1.03
setNodeAtDepth depth 2 x100000 15.557 ms/op 16.319 ms/op 0.95
getNodesAtDepth depth 2 x100000 18.975 ms/op 17.145 ms/op 1.11
setNodesAtDepth depth 2 x100000 25.437 ms/op 24.458 ms/op 1.04
tree.getNodesAtDepth - gindexes 10.600 ms/op 8.8692 ms/op 1.20
tree.getNodesAtDepth - push all nodes 2.5137 ms/op 1.9502 ms/op 1.29
tree.getNodesAtDepth - navigation 311.71 us/op 315.00 us/op 0.99
tree.setNodesAtDepth - indexes 833.28 us/op 641.63 us/op 1.30
set at depth 8 945.00 ns/op 798.00 ns/op 1.18
set at depth 16 1.3500 us/op 1.0240 us/op 1.32
set at depth 32 2.4510 us/op 1.8740 us/op 1.31
iterateNodesAtDepth 8 256 15.986 us/op 13.498 us/op 1.18
getNodesAtDepth 8 256 3.9590 us/op 3.5850 us/op 1.10
iterateNodesAtDepth 16 65536 4.9460 ms/op 4.4050 ms/op 1.12
getNodesAtDepth 16 65536 1.3133 ms/op 1.1365 ms/op 1.16
iterateNodesAtDepth 32 250000 18.354 ms/op 16.056 ms/op 1.14
getNodesAtDepth 32 250000 5.8929 ms/op 4.5446 ms/op 1.30
iterateNodesAtDepth 40 250000 18.934 ms/op 15.750 ms/op 1.20
getNodesAtDepth 40 250000 5.4706 ms/op 4.5249 ms/op 1.21
250000 validators root getter 100.05 ms/op 98.254 ms/op 1.02
250000 validators batchHash() 96.966 ms/op 87.307 ms/op 1.11
250000 validators hashComputations 19.368 ms/op 15.996 ms/op 1.21
bitlist bytes to struct (120,90) 532.00 ns/op 614.00 ns/op 0.87
bitlist bytes to tree (120,90) 2.5960 us/op 2.1610 us/op 1.20
bitlist bytes to struct (2048,2048) 1.0270 us/op 947.00 ns/op 1.08
bitlist bytes to tree (2048,2048) 3.9390 us/op 3.6190 us/op 1.09
ByteListType - deserialize 10.925 ms/op 9.2636 ms/op 1.18
BasicListType - deserialize 10.330 ms/op 10.026 ms/op 1.03
ByteListType - serialize 11.363 ms/op 9.6820 ms/op 1.17
BasicListType - serialize 13.204 ms/op 11.445 ms/op 1.15
BasicListType - tree_convertToStruct 25.331 ms/op 23.078 ms/op 1.10
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.6206 ms/op 5.2712 ms/op 1.07
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.5574 ms/op 4.3790 ms/op 1.04
Array.push len 300000 empty Array - number 7.6195 ms/op 7.5548 ms/op 1.01
Array.set len 300000 from new Array - number 2.3905 ms/op 2.2722 ms/op 1.05
Array.set len 300000 - number 7.3587 ms/op 6.3610 ms/op 1.16
Uint8Array.set len 300000 409.89 us/op 386.61 us/op 1.06
Uint32Array.set len 300000 526.55 us/op 464.26 us/op 1.13
Container({a: uint8, b: uint8}) getViewDU x300000 35.156 ms/op 29.421 ms/op 1.19
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 11.173 ms/op 10.659 ms/op 1.05
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 224.23 ms/op 214.78 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 237.53 ms/op 244.99 ms/op 0.97
List(Container) len 300000 ViewDU.get(i) 6.5787 ms/op 6.6598 ms/op 0.99
List(Container) len 300000 ViewDU.getReadonly(i) 6.6709 ms/op 6.5793 ms/op 1.01
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 38.214 ms/op 38.778 ms/op 0.99
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.4524 ms/op 5.1100 ms/op 1.07
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 7.3018 ms/op 6.1435 ms/op 1.19
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.2680 ms/op 6.1105 ms/op 1.03
Array.push len 300000 empty Array - object 6.7929 ms/op 6.3379 ms/op 1.07
Array.set len 300000 from new Array - object 2.1715 ms/op 1.9922 ms/op 1.09
Array.set len 300000 - object 6.4966 ms/op 6.2674 ms/op 1.04
cachePermanentRootStruct no cache 3.1920 us/op 3.1900 us/op 1.00
cachePermanentRootStruct with cache 168.00 ns/op 186.00 ns/op 0.90
epochParticipation len 250000 rws 7813 2.5487 ms/op 2.4497 ms/op 1.04
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 4.7754 ms/op 4.7278 ms/op 1.01
BeaconState ViewDU batchHashTreeRoot vc=200000 mod=100000 220.98 ms/op 219.76 ms/op 1.01
BeaconState ViewDU batchHashTreeRoot - commit step vc=200000 mod=100000 181.58 ms/op 187.30 ms/op 0.97
BeaconState ViewDU batchHashTreeRoot - hash step vc=200000 mod=100000 48.067 ms/op 48.590 ms/op 0.99
BeaconState ViewDU hashTreeRoot() vc=200000 mod=100000 697.68 ms/op 707.50 ms/op 0.99
BeaconState ViewDU hashTreeRoot - commit step vc=200000 mod=100000 66.446 ms/op 67.254 ms/op 0.99
BeaconState ViewDU hashTreeRoot - validator tree creation vc=100000 mod=100000 263.36 ms/op 285.35 ms/op 0.92
deserialize Attestation - tree 4.0490 us/op 3.6360 us/op 1.11
deserialize Attestation - struct 1.9790 us/op 1.9300 us/op 1.03
deserialize Attestation - struct (reuse bytes) 1.4380 us/op 1.4420 us/op 1.00
deserialize SignedAggregateAndProof - tree 4.9970 us/op 4.7470 us/op 1.05
deserialize SignedAggregateAndProof - struct 3.2540 us/op 3.0700 us/op 1.06
deserialize SignedAggregateAndProof - struct (reuse bytes) 2.0860 us/op 1.8980 us/op 1.10
deserialize SyncCommitteeMessage - tree 1.5800 us/op 1.4320 us/op 1.10
deserialize SyncCommitteeMessage - struct 1.0570 us/op 1.1040 us/op 0.96
deserialize SyncCommitteeMessage - struct (reuse bytes) 734.00 ns/op 747.00 ns/op 0.98
deserialize SignedContributionAndProof - tree 2.9520 us/op 2.8380 us/op 1.04
deserialize SignedContributionAndProof - struct 2.3690 us/op 2.3490 us/op 1.01
deserialize SignedContributionAndProof - struct (reuse bytes) 1.2360 us/op 1.2590 us/op 0.98
deserialize SignedBeaconBlock - tree 284.88 us/op 274.29 us/op 1.04
deserialize SignedBeaconBlock - struct 126.98 us/op 119.72 us/op 1.06
deserialize SignedBeaconBlock - struct (reuse bytes) 78.058 us/op 77.618 us/op 1.01
BeaconState vc 300000 - deserialize tree 678.84 ms/op 646.49 ms/op 1.05
BeaconState vc 300000 - serialize tree 90.612 ms/op 98.613 ms/op 0.92
BeaconState.historicalRoots vc 300000 - deserialize tree 922.00 ns/op 960.00 ns/op 0.96
BeaconState.historicalRoots vc 300000 - serialize tree 692.00 ns/op 664.00 ns/op 1.04
BeaconState.validators vc 300000 - deserialize tree 623.93 ms/op 614.64 ms/op 1.02
BeaconState.validators vc 300000 - serialize tree 32.367 ms/op 32.704 ms/op 0.99
BeaconState.balances vc 300000 - deserialize tree 30.111 ms/op 29.920 ms/op 1.01
BeaconState.balances vc 300000 - serialize tree 4.2453 ms/op 3.6424 ms/op 1.17
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.0124 ms/op 935.29 us/op 1.08
BeaconState.previousEpochParticipation vc 300000 - serialize tree 328.86 us/op 328.24 us/op 1.00
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.0082 ms/op 933.86 us/op 1.08
BeaconState.currentEpochParticipation vc 300000 - serialize tree 326.01 us/op 327.86 us/op 0.99
BeaconState.inactivityScores vc 300000 - deserialize tree 27.257 ms/op 28.918 ms/op 0.94
BeaconState.inactivityScores vc 300000 - serialize tree 4.5195 ms/op 3.7949 ms/op 1.19
hashTreeRoot Attestation - struct 11.466 us/op 9.8730 us/op 1.16
hashTreeRoot Attestation - tree 7.5680 us/op 7.6080 us/op 0.99
hashTreeRoot SignedAggregateAndProof - struct 13.383 us/op 13.107 us/op 1.02
hashTreeRoot SignedAggregateAndProof - tree 10.966 us/op 11.082 us/op 0.99
hashTreeRoot SyncCommitteeMessage - struct 3.4240 us/op 3.1670 us/op 1.08
hashTreeRoot SyncCommitteeMessage - tree 2.8950 us/op 2.7950 us/op 1.04
hashTreeRoot SignedContributionAndProof - struct 8.3410 us/op 7.8360 us/op 1.06
hashTreeRoot SignedContributionAndProof - tree 7.6300 us/op 7.7060 us/op 0.99
hashTreeRoot SignedBeaconBlock - struct 830.87 us/op 724.91 us/op 1.15
hashTreeRoot SignedBeaconBlock - tree 660.29 us/op 671.50 us/op 0.98
hashTreeRoot Validator - struct 4.4930 us/op 4.3270 us/op 1.04
hashTreeRoot Validator - tree 5.8790 us/op 5.8500 us/op 1.00
BeaconState vc 300000 - hashTreeRoot tree 2.0040 s/op 1.9975 s/op 1.00
BeaconState vc 300000 - batchHashTreeRoot tree 4.1047 s/op 3.9805 s/op 1.03
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 882.00 ns/op 853.00 ns/op 1.03
BeaconState.validators vc 300000 - hashTreeRoot tree 2.3270 s/op 2.1700 s/op 1.07
BeaconState.balances vc 300000 - hashTreeRoot tree 32.387 ms/op 28.342 ms/op 1.14
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 3.4542 ms/op 3.5151 ms/op 0.98
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 3.4533 ms/op 3.5226 ms/op 0.98
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 31.043 ms/op 47.214 ms/op 0.66
hash64 x18 8.2900 us/op 7.7300 us/op 1.07
hashTwoObjects x18 6.4950 us/op 6.7540 us/op 0.96
hash64 x1740 743.51 us/op 661.73 us/op 1.12
hashTwoObjects x1740 601.71 us/op 615.60 us/op 0.98
hash64 x2700000 1.1739 s/op 1.0207 s/op 1.15
hashTwoObjects x2700000 928.49 ms/op 956.86 ms/op 0.97
get_exitEpoch - ContainerType 314.00 ns/op 237.00 ns/op 1.32
get_exitEpoch - ContainerNodeStructType 241.00 ns/op 238.00 ns/op 1.01
set_exitEpoch - ContainerType 275.00 ns/op 273.00 ns/op 1.01
set_exitEpoch - ContainerNodeStructType 250.00 ns/op 240.00 ns/op 1.04
get_pubkey - ContainerType 1.0740 us/op 962.00 ns/op 1.12
get_pubkey - ContainerNodeStructType 264.00 ns/op 249.00 ns/op 1.06
hashTreeRoot - ContainerType 506.00 ns/op 478.00 ns/op 1.06
hashTreeRoot - ContainerNodeStructType 546.00 ns/op 495.00 ns/op 1.10
createProof - ContainerType 4.1000 us/op 3.9280 us/op 1.04
createProof - ContainerNodeStructType 22.140 us/op 21.126 us/op 1.05
serialize - ContainerType 1.9080 us/op 1.7290 us/op 1.10
serialize - ContainerNodeStructType 1.2640 us/op 1.1660 us/op 1.08
set_exitEpoch_and_hashTreeRoot - ContainerType 2.6980 us/op 2.9230 us/op 0.92
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 6.9090 us/op 6.4980 us/op 1.06
doBatchHashTreeRootValidators 3.7950 us/op 3.5550 us/op 1.07
ContainerNodeStructViewDU hashTreeRoot 24.381 us/op 22.067 us/op 1.10
Array - for of 11.278 us/op 5.4770 us/op 2.06
Array - for(;;) 11.245 us/op 5.6610 us/op 1.99
basicListValue.readonlyValuesArray() 4.7879 ms/op 4.3820 ms/op 1.09
basicListValue.readonlyValuesArray() + loop all 5.5495 ms/op 4.4728 ms/op 1.24
compositeListValue.readonlyValuesArray() 32.829 ms/op 26.898 ms/op 1.22
compositeListValue.readonlyValuesArray() + loop all 31.280 ms/op 31.506 ms/op 0.99
Number64UintType - get balances list 4.8115 ms/op 4.8027 ms/op 1.00
Number64UintType - set balances list 10.035 ms/op 10.127 ms/op 0.99
Number64UintType - get and increase 10 then set 40.589 ms/op 41.465 ms/op 0.98
Number64UintType - increase 10 using applyDelta 14.763 ms/op 17.005 ms/op 0.87
Number64UintType - increase 10 using applyDeltaInBatch 14.668 ms/op 17.032 ms/op 0.86
tree_newTreeFromUint64Deltas 21.251 ms/op 19.618 ms/op 1.08
unsafeUint8ArrayToTree 41.421 ms/op 35.584 ms/op 1.16
bitLength(50) 281.00 ns/op 251.00 ns/op 1.12
bitLengthStr(50) 285.00 ns/op 221.00 ns/op 1.29
bitLength(8000) 278.00 ns/op 238.00 ns/op 1.17
bitLengthStr(8000) 303.00 ns/op 297.00 ns/op 1.02
bitLength(250000) 283.00 ns/op 225.00 ns/op 1.26
bitLengthStr(250000) 342.00 ns/op 301.00 ns/op 1.14
merkleize 32 chunks 13.716 us/op 12.260 us/op 1.12
merkleizeBlocksBytes 32 chunks 3.2160 us/op 3.0470 us/op 1.06
merkleizeBlockArray 32 chunks 6.2090 us/op 5.9830 us/op 1.04
merkleize 128 chunks 52.238 us/op 48.122 us/op 1.09
merkleizeBlocksBytes 128 chunks 7.5130 us/op 7.2640 us/op 1.03
merkleizeBlockArray 128 chunks 17.650 us/op 16.662 us/op 1.06
merkleize 512 chunks 217.44 us/op 194.93 us/op 1.12
merkleizeBlocksBytes 512 chunks 22.471 us/op 22.592 us/op 0.99
merkleizeBlockArray 512 chunks 61.047 us/op 58.428 us/op 1.04
merkleize 1024 chunks 426.47 us/op 390.37 us/op 1.09
merkleizeBlocksBytes 1024 chunks 42.391 us/op 42.233 us/op 1.00
merkleizeBlockArray 1024 chunks 120.22 us/op 112.87 us/op 1.07
floor - Math.floor (53) 1.2443 ns/op 1.2441 ns/op 1.00
floor - << 0 (53) 1.2441 ns/op 1.2434 ns/op 1.00
floor - Math.floor (512) 1.2452 ns/op 1.2431 ns/op 1.00
floor - << 0 (512) 1.2441 ns/op 1.2443 ns/op 1.00
fnIf(0) 1.5549 ns/op 1.5570 ns/op 1.00
fnSwitch(0) 2.1801 ns/op 2.1813 ns/op 1.00
fnObj(0) 1.5603 ns/op 1.5608 ns/op 1.00
fnArr(0) 1.5551 ns/op 1.5563 ns/op 1.00
fnIf(4) 2.1775 ns/op 2.1758 ns/op 1.00
fnSwitch(4) 2.1771 ns/op 2.1751 ns/op 1.00
fnObj(4) 1.5618 ns/op 1.5613 ns/op 1.00
fnArr(4) 1.5558 ns/op 1.5566 ns/op 1.00
fnIf(9) 3.1117 ns/op 3.1098 ns/op 1.00
fnSwitch(9) 2.1796 ns/op 2.1754 ns/op 1.00
fnObj(9) 1.5567 ns/op 1.5665 ns/op 0.99
fnArr(9) 1.5589 ns/op 1.5592 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.78 us/op 124.61 us/op 1.00
Container {a,b,vec} - as tree x100000 560.04 us/op 559.11 us/op 1.00
Container {a,vec,b} - as struct x100000 155.93 us/op 155.68 us/op 1.00
Container {a,vec,b} - as tree x100000 559.98 us/op 562.46 us/op 1.00
get 2 props x1000000 - rawObject 312.09 us/op 311.65 us/op 1.00
get 2 props x1000000 - proxy 73.123 ms/op 73.227 ms/op 1.00
get 2 props x1000000 - customObj 312.01 us/op 311.74 us/op 1.00
Simple object binary -> struct 579.00 ns/op 612.00 ns/op 0.95
Simple object binary -> tree_backed 1.9860 us/op 1.6380 us/op 1.21
Simple object struct -> tree_backed 2.4050 us/op 2.2600 us/op 1.06
Simple object tree_backed -> struct 1.5570 us/op 1.5120 us/op 1.03
Simple object struct -> binary 955.00 ns/op 858.00 ns/op 1.11
Simple object tree_backed -> binary 1.3530 us/op 1.2300 us/op 1.10
aggregationBits binary -> struct 525.00 ns/op 474.00 ns/op 1.11
aggregationBits binary -> tree_backed 2.2370 us/op 2.1170 us/op 1.06
aggregationBits struct -> tree_backed 2.7580 us/op 2.4110 us/op 1.14
aggregationBits tree_backed -> struct 1.0400 us/op 956.00 ns/op 1.09
aggregationBits struct -> binary 740.00 ns/op 703.00 ns/op 1.05
aggregationBits tree_backed -> binary 928.00 ns/op 836.00 ns/op 1.11
List(uint8) 100000 binary -> struct 1.0322 ms/op 950.64 us/op 1.09
List(uint8) 100000 binary -> tree_backed 307.10 us/op 267.40 us/op 1.15
List(uint8) 100000 struct -> tree_backed 1.3863 ms/op 1.3348 ms/op 1.04
List(uint8) 100000 tree_backed -> struct 1.1410 ms/op 986.44 us/op 1.16
List(uint8) 100000 struct -> binary 1.0889 ms/op 1.0605 ms/op 1.03
List(uint8) 100000 tree_backed -> binary 119.46 us/op 107.30 us/op 1.11
List(uint64Number) 100000 binary -> struct 1.4145 ms/op 1.2978 ms/op 1.09
List(uint64Number) 100000 binary -> tree_backed 5.0128 ms/op 4.3786 ms/op 1.14
List(uint64Number) 100000 struct -> tree_backed 6.5262 ms/op 6.7197 ms/op 0.97
List(uint64Number) 100000 tree_backed -> struct 2.4067 ms/op 2.5805 ms/op 0.93
List(uint64Number) 100000 struct -> binary 1.4155 ms/op 1.4111 ms/op 1.00
List(uint64Number) 100000 tree_backed -> binary 1.1940 ms/op 1.0116 ms/op 1.18
List(Uint64Bigint) 100000 binary -> struct 3.9980 ms/op 3.6658 ms/op 1.09
List(Uint64Bigint) 100000 binary -> tree_backed 5.0691 ms/op 4.8999 ms/op 1.03
List(Uint64Bigint) 100000 struct -> tree_backed 7.8016 ms/op 7.0542 ms/op 1.11
List(Uint64Bigint) 100000 tree_backed -> struct 5.3732 ms/op 4.9408 ms/op 1.09
List(Uint64Bigint) 100000 struct -> binary 2.0997 ms/op 2.1262 ms/op 0.99
List(Uint64Bigint) 100000 tree_backed -> binary 1.2859 ms/op 1.1457 ms/op 1.12
Vector(Root) 100000 binary -> struct 38.638 ms/op 33.789 ms/op 1.14
Vector(Root) 100000 binary -> tree_backed 42.716 ms/op 35.838 ms/op 1.19
Vector(Root) 100000 struct -> tree_backed 53.310 ms/op 50.266 ms/op 1.06
Vector(Root) 100000 tree_backed -> struct 54.447 ms/op 50.325 ms/op 1.08
Vector(Root) 100000 struct -> binary 3.1195 ms/op 3.0969 ms/op 1.01
Vector(Root) 100000 tree_backed -> binary 7.8281 ms/op 6.8646 ms/op 1.14
List(Validator) 100000 binary -> struct 114.39 ms/op 116.34 ms/op 0.98
List(Validator) 100000 binary -> tree_backed 346.66 ms/op 349.97 ms/op 0.99
List(Validator) 100000 struct -> tree_backed 399.49 ms/op 373.13 ms/op 1.07
List(Validator) 100000 tree_backed -> struct 222.50 ms/op 212.94 ms/op 1.04
List(Validator) 100000 struct -> binary 30.677 ms/op 31.648 ms/op 0.97
List(Validator) 100000 tree_backed -> binary 114.75 ms/op 110.66 ms/op 1.04
List(Validator-NS) 100000 binary -> struct 116.12 ms/op 109.86 ms/op 1.06
List(Validator-NS) 100000 binary -> tree_backed 163.93 ms/op 159.86 ms/op 1.03
List(Validator-NS) 100000 struct -> tree_backed 185.87 ms/op 185.59 ms/op 1.00
List(Validator-NS) 100000 tree_backed -> struct 154.79 ms/op 152.79 ms/op 1.01
List(Validator-NS) 100000 struct -> binary 7.7527 ms/op 7.4536 ms/op 1.04
List(Validator-NS) 100000 tree_backed -> binary 14.292 ms/op 13.555 ms/op 1.05
get epochStatuses - MutableVector 118.72 us/op 106.17 us/op 1.12
get epochStatuses - ViewDU 175.03 us/op 212.36 us/op 0.82
set epochStatuses - ListTreeView 2.1904 ms/op 2.2542 ms/op 0.97
set epochStatuses - ListTreeView - set() 445.85 us/op 444.02 us/op 1.00
set epochStatuses - ListTreeView - commit() 832.83 us/op 810.20 us/op 1.03
bitstring 518.48 ns/op 516.76 ns/op 1.00
bit mask 13.816 ns/op 13.986 ns/op 0.99
struct - increase slot to 1000000 937.91 us/op 934.14 us/op 1.00
UintNumberType - increase slot to 1000000 27.755 ms/op 27.723 ms/op 1.00
UintBigintType - increase slot to 1000000 175.68 ms/op 176.91 ms/op 0.99
UintBigint8 x 100000 tree_deserialize 6.0912 ms/op 5.5983 ms/op 1.09
UintBigint8 x 100000 tree_serialize 615.32 us/op 1.1307 ms/op 0.54
UintBigint16 x 100000 tree_deserialize 6.0496 ms/op 5.7119 ms/op 1.06
UintBigint16 x 100000 tree_serialize 1.4555 ms/op 1.3910 ms/op 1.05
UintBigint32 x 100000 tree_deserialize 5.9326 ms/op 5.6237 ms/op 1.05
UintBigint32 x 100000 tree_serialize 1.8669 ms/op 1.8653 ms/op 1.00
UintBigint64 x 100000 tree_deserialize 6.7587 ms/op 5.9823 ms/op 1.13
UintBigint64 x 100000 tree_serialize 1.7936 ms/op 2.5277 ms/op 0.71
UintBigint8 x 100000 value_deserialize 407.31 us/op 406.04 us/op 1.00
UintBigint8 x 100000 value_serialize 773.58 us/op 766.69 us/op 1.01
UintBigint16 x 100000 value_deserialize 467.91 us/op 466.64 us/op 1.00
UintBigint16 x 100000 value_serialize 844.71 us/op 814.79 us/op 1.04
UintBigint32 x 100000 value_deserialize 497.79 us/op 500.03 us/op 1.00
UintBigint32 x 100000 value_serialize 915.32 us/op 846.72 us/op 1.08
UintBigint64 x 100000 value_deserialize 531.82 us/op 530.92 us/op 1.00
UintBigint64 x 100000 value_serialize 1.0165 ms/op 1.0042 ms/op 1.01
UintBigint8 x 100000 deserialize 3.6761 ms/op 3.2535 ms/op 1.13
UintBigint8 x 100000 serialize 1.5919 ms/op 1.6068 ms/op 0.99
UintBigint16 x 100000 deserialize 3.4726 ms/op 3.4967 ms/op 0.99
UintBigint16 x 100000 serialize 1.5641 ms/op 1.5149 ms/op 1.03
UintBigint32 x 100000 deserialize 3.1847 ms/op 3.4106 ms/op 0.93
UintBigint32 x 100000 serialize 3.0253 ms/op 2.8734 ms/op 1.05
UintBigint64 x 100000 deserialize 4.0950 ms/op 4.4511 ms/op 0.92
UintBigint64 x 100000 serialize 1.6477 ms/op 1.6740 ms/op 0.98
UintBigint128 x 100000 deserialize 6.0049 ms/op 5.8782 ms/op 1.02
UintBigint128 x 100000 serialize 15.216 ms/op 16.267 ms/op 0.94
UintBigint256 x 100000 deserialize 8.9195 ms/op 9.0878 ms/op 0.98
UintBigint256 x 100000 serialize 43.805 ms/op 47.280 ms/op 0.93
Slice from Uint8Array x25000 1.2579 ms/op 1.3900 ms/op 0.90
Slice from ArrayBuffer x25000 16.314 ms/op 16.296 ms/op 1.00
Slice from ArrayBuffer x25000 + new Uint8Array 16.794 ms/op 18.121 ms/op 0.93
Copy Uint8Array 100000 iterate 1.7062 ms/op 1.6913 ms/op 1.01
Copy Uint8Array 100000 slice 127.08 us/op 108.76 us/op 1.17
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 126.35 us/op 107.27 us/op 1.18
Copy Buffer 100000 Uint8Array.prototype.slice.call 125.49 us/op 107.10 us/op 1.17
Copy Uint8Array 100000 slice + set 270.93 us/op 216.71 us/op 1.25
Copy Uint8Array 100000 subarray + set 124.95 us/op 109.84 us/op 1.14
Copy Uint8Array 100000 slice arrayBuffer 126.52 us/op 107.78 us/op 1.17
Uint64 deserialize 100000 - iterate Uint8Array 2.3155 ms/op 1.9106 ms/op 1.21
Uint64 deserialize 100000 - by Uint32A 2.2598 ms/op 1.9005 ms/op 1.19
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.2340 ms/op 1.9633 ms/op 1.14
Uint64 deserialize 100000 - by DataView.getBigUint64 5.3971 ms/op 4.8660 ms/op 1.11
Uint64 deserialize 100000 - by byte 40.842 ms/op 40.466 ms/op 1.01

by benchmarkbot/action

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. essentially just a relaxation of the param type from thing[] to ArrayLike<thing>

@wemeetagain wemeetagain merged commit 1d0ff62 into master Mar 17, 2026
9 checks passed
@wemeetagain wemeetagain deleted the nflaig/array-like branch March 17, 2026 20:25
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