Skip to content

feat: add progressive types#528

Open
wemeetagain wants to merge 2 commits into
masterfrom
cayman/progressives
Open

feat: add progressive types#528
wemeetagain wants to merge 2 commits into
masterfrom
cayman/progressives

Conversation

@wemeetagain
Copy link
Copy Markdown
Member

Motivation

Description

  • Add ProgressiveList, ProgressiveBitlist, ProgressiveContainer, CompatibleUnion
  • Add spec tests for the same

@wemeetagain wemeetagain requested a review from a team as a code owner May 11, 2026 15:16
@github-actions github-actions Bot added the ssz label May 11, 2026
@nazarhussain nazarhussain self-requested a review May 11, 2026 15:17
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dca3c9673b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +305 to +306
case "data":
return this.representativeType;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid using representative type for data path typing

Returning this.representativeType for getPropertyType("data") makes nested proof-path resolution incorrect when a CompatibleUnion is embedded in parents that still use getPathInfo traversal (e.g. StableContainerType.tree_createProofGindexes in packages/ssz/src/type/stableContainer.ts:434). In that flow, a path like ["unionField", "data", "newField"] is validated against the representative option instead of the active selector, so proofs for selector-specific fields throw Unknown ... property or resolve the wrong subtree even though CompatibleUnion.tree_createProofGindexes itself supports selector-aware traversal.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d1132be Previous: 07fb121 Ratio
digestTwoHashObjects 50023 times 47.889 ms/op 47.915 ms/op 1.00
digest2Bytes32 50023 times 54.942 ms/op 54.633 ms/op 1.01
digest 50023 times 53.971 ms/op 53.090 ms/op 1.02
input length 32 1.2410 us/op 1.1970 us/op 1.04
input length 64 1.4220 us/op 1.3520 us/op 1.05
input length 128 2.3400 us/op 2.2800 us/op 1.03
input length 256 3.4590 us/op 3.4090 us/op 1.01
input length 512 5.7090 us/op 5.6230 us/op 1.02
input length 1024 10.752 us/op 10.612 us/op 1.01
digest 1000000 times 864.94 ms/op 875.73 ms/op 0.99
hashObjectToByteArray 50023 times 937.28 us/op 938.49 us/op 1.00
byteArrayToHashObject 50023 times 1.3053 ms/op 1.3024 ms/op 1.00
digest64 200092 times 214.27 ms/op 215.79 ms/op 0.99
hash 200092 times using batchHash4UintArray64s 226.98 ms/op 232.96 ms/op 0.97
digest64HashObjects 200092 times 191.99 ms/op 191.29 ms/op 1.00
hash 200092 times using batchHash4HashObjectInputs 199.36 ms/op 191.55 ms/op 1.04
getGindicesAtDepth 3.5920 us/op 3.5510 us/op 1.01
iterateAtDepth 6.4660 us/op 6.4280 us/op 1.01
getGindexBits 477.00 ns/op 454.00 ns/op 1.05
gindexIterator 965.00 ns/op 906.00 ns/op 1.07
HashComputationLevel.push then loop 25.780 ms/op 25.657 ms/op 1.00
HashComputation[] push then loop 46.828 ms/op 37.143 ms/op 1.26
hash 2 32 bytes Uint8Array 500000 times - hashtree 156.37 ms/op 150.01 ms/op 1.04
batch hash 16 x 64 Uint8Array 31250 times - hashtree 25.184 ms/op 24.421 ms/op 1.03
hashTwoObjects 500000 times - hashtree 177.88 ms/op 167.01 ms/op 1.07
executeHashComputations - hashtree 8.9729 ms/op 8.9507 ms/op 1.00
hash 2 32 bytes Uint8Array 500000 times - as-sha256 497.25 ms/op 489.72 ms/op 1.02
batch hash 16 x 64 Uint8Array 31250 times - as-sha256 500.84 ms/op 495.49 ms/op 1.01
hashTwoObjects 500000 times - as-sha256 507.55 ms/op 507.78 ms/op 1.00
executeHashComputations - as-sha256 45.496 ms/op 44.882 ms/op 1.01
hash 2 32 bytes Uint8Array 500000 times - noble 1.2588 s/op 1.2256 s/op 1.03
batch hash 16 x 64 Uint8Array 31250 times - noble 1.2167 s/op 1.1632 s/op 1.05
hashTwoObjects 500000 times - noble 1.5427 s/op 1.5204 s/op 1.01
executeHashComputations - noble 36.152 ms/op 36.088 ms/op 1.00
getHashComputations 2.0962 ms/op 2.1336 ms/op 0.98
executeHashComputations 9.1159 ms/op 9.6364 ms/op 0.95
get root 12.749 ms/op 12.648 ms/op 1.01
getNodeH() x7812.5 avg hindex 12.228 us/op 12.254 us/op 1.00
getNodeH() x7812.5 index 0 7.4950 us/op 7.4880 us/op 1.00
getNodeH() x7812.5 index 7 7.6020 us/op 7.5300 us/op 1.01
getNodeH() x7812.5 index 7 with key array 6.2730 us/op 6.2770 us/op 1.00
new LeafNode() x7812.5 292.02 us/op 307.00 us/op 0.95
getHashComputations 250000 nodes 14.699 ms/op 14.811 ms/op 0.99
batchHash 250000 nodes 81.183 ms/op 84.659 ms/op 0.96
get root 250000 nodes 95.306 ms/op 95.076 ms/op 1.00
getHashComputations 500000 nodes 28.351 ms/op 28.583 ms/op 0.99
batchHash 500000 nodes 148.08 ms/op 148.96 ms/op 0.99
get root 500000 nodes 189.14 ms/op 196.24 ms/op 0.96
getHashComputations 1000000 nodes 61.910 ms/op 56.188 ms/op 1.10
batchHash 1000000 nodes 351.81 ms/op 355.89 ms/op 0.99
get root 1000000 nodes 377.99 ms/op 378.63 ms/op 1.00
multiproof - depth 15, 1 requested leaves 7.5540 us/op 7.3290 us/op 1.03
tree offset multiproof - depth 15, 1 requested leaves 17.134 us/op 16.758 us/op 1.02
compact multiproof - depth 15, 1 requested leaves 3.3570 us/op 3.4180 us/op 0.98
multiproof - depth 15, 2 requested leaves 10.826 us/op 10.749 us/op 1.01
tree offset multiproof - depth 15, 2 requested leaves 20.436 us/op 20.137 us/op 1.01
compact multiproof - depth 15, 2 requested leaves 3.2290 us/op 3.2570 us/op 0.99
multiproof - depth 15, 3 requested leaves 15.137 us/op 15.314 us/op 0.99
tree offset multiproof - depth 15, 3 requested leaves 26.493 us/op 26.062 us/op 1.02
compact multiproof - depth 15, 3 requested leaves 3.7840 us/op 3.7540 us/op 1.01
multiproof - depth 15, 4 requested leaves 20.142 us/op 20.132 us/op 1.00
tree offset multiproof - depth 15, 4 requested leaves 32.737 us/op 31.876 us/op 1.03
compact multiproof - depth 15, 4 requested leaves 4.0230 us/op 4.1740 us/op 0.96
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.8240 us/op 5.6630 us/op 1.03
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.8700 us/op 5.7120 us/op 1.03
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.7710 us/op 5.6850 us/op 1.02
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.7990 us/op 5.7070 us/op 1.02
subtreeFillToContents depth 40 count 250000 48.866 ms/op 48.202 ms/op 1.01
setRoot - gindexBitstring 20.390 ms/op 20.198 ms/op 1.01
setRoot - gindex 20.936 ms/op 19.883 ms/op 1.05
getRoot - gindexBitstring 2.4426 ms/op 2.3568 ms/op 1.04
getRoot - gindex 2.9176 ms/op 2.9568 ms/op 0.99
getHashObject then setHashObject 21.421 ms/op 20.355 ms/op 1.05
setNodeWithFn 19.311 ms/op 18.265 ms/op 1.06
getNodeAtDepth depth 0 x100000 280.75 us/op 280.61 us/op 1.00
setNodeAtDepth depth 0 x100000 2.4473 ms/op 2.2398 ms/op 1.09
getNodesAtDepth depth 0 x100000 313.40 us/op 312.64 us/op 1.00
setNodesAtDepth depth 0 x100000 762.20 us/op 761.45 us/op 1.00
getNodeAtDepth depth 1 x100000 342.88 us/op 342.60 us/op 1.00
setNodeAtDepth depth 1 x100000 8.4846 ms/op 7.7272 ms/op 1.10
getNodesAtDepth depth 1 x100000 437.11 us/op 436.34 us/op 1.00
setNodesAtDepth depth 1 x100000 6.7215 ms/op 6.2632 ms/op 1.07
getNodeAtDepth depth 2 x100000 735.44 us/op 840.44 us/op 0.88
setNodeAtDepth depth 2 x100000 15.993 ms/op 14.458 ms/op 1.11
getNodesAtDepth depth 2 x100000 16.225 ms/op 16.326 ms/op 0.99
setNodesAtDepth depth 2 x100000 21.519 ms/op 21.660 ms/op 0.99
tree.getNodesAtDepth - gindexes 7.2579 ms/op 7.4951 ms/op 0.97
tree.getNodesAtDepth - push all nodes 2.1362 ms/op 1.8890 ms/op 1.13
tree.getNodesAtDepth - navigation 312.16 us/op 312.31 us/op 1.00
tree.setNodesAtDepth - indexes 665.86 us/op 634.32 us/op 1.05
set at depth 8 840.00 ns/op 784.00 ns/op 1.07
set at depth 16 1.1620 us/op 1.1000 us/op 1.06
set at depth 32 2.0150 us/op 1.8690 us/op 1.08
iterateNodesAtDepth 8 256 13.751 us/op 13.453 us/op 1.02
getNodesAtDepth 8 256 3.6390 us/op 3.5440 us/op 1.03
iterateNodesAtDepth 16 65536 4.3108 ms/op 4.2754 ms/op 1.01
getNodesAtDepth 16 65536 1.1421 ms/op 1.1099 ms/op 1.03
iterateNodesAtDepth 32 250000 15.789 ms/op 15.643 ms/op 1.01
getNodesAtDepth 32 250000 4.7709 ms/op 4.4346 ms/op 1.08
iterateNodesAtDepth 40 250000 15.843 ms/op 15.695 ms/op 1.01
getNodesAtDepth 40 250000 4.7590 ms/op 4.4623 ms/op 1.07
250000 validators root getter 96.347 ms/op 95.848 ms/op 1.01
250000 validators batchHash() 95.853 ms/op 80.944 ms/op 1.18
250000 validators hashComputations 15.562 ms/op 14.537 ms/op 1.07
bitlist bytes to struct (120,90) 499.00 ns/op 488.00 ns/op 1.02
bitlist bytes to tree (120,90) 2.0900 us/op 2.1350 us/op 0.98
bitlist bytes to struct (2048,2048) 912.00 ns/op 867.00 ns/op 1.05
bitlist bytes to tree (2048,2048) 3.4800 us/op 3.5940 us/op 0.97
ByteListType - deserialize 7.7100 ms/op 7.9144 ms/op 0.97
BasicListType - deserialize 9.5306 ms/op 9.9586 ms/op 0.96
ByteListType - serialize 8.1127 ms/op 7.9185 ms/op 1.02
BasicListType - serialize 9.6462 ms/op 9.6603 ms/op 1.00
BasicListType - tree_convertToStruct 20.875 ms/op 21.030 ms/op 0.99
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.7826 ms/op 5.0595 ms/op 0.95
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.3863 ms/op 4.3942 ms/op 1.00
Array.push len 300000 empty Array - number 6.1128 ms/op 6.4381 ms/op 0.95
Array.set len 300000 from new Array - number 1.8748 ms/op 2.0644 ms/op 0.91
Array.set len 300000 - number 5.9059 ms/op 6.3628 ms/op 0.93
Uint8Array.set len 300000 374.81 us/op 374.16 us/op 1.00
Uint32Array.set len 300000 438.38 us/op 432.51 us/op 1.01
Container({a: uint8, b: uint8}) getViewDU x300000 29.902 ms/op 29.634 ms/op 1.01
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 10.576 ms/op 10.539 ms/op 1.00
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 209.06 ms/op 200.23 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 229.68 ms/op 229.83 ms/op 1.00
List(Container) len 300000 ViewDU.get(i) 6.4922 ms/op 6.4768 ms/op 1.00
List(Container) len 300000 ViewDU.getReadonly(i) 6.4763 ms/op 6.4676 ms/op 1.00
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 36.933 ms/op 37.227 ms/op 0.99
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.2462 ms/op 4.8968 ms/op 1.07
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.0359 ms/op 6.0215 ms/op 1.00
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.0563 ms/op 6.0288 ms/op 1.00
Array.push len 300000 empty Array - object 6.0585 ms/op 5.9920 ms/op 1.01
Array.set len 300000 from new Array - object 1.9703 ms/op 1.9911 ms/op 0.99
Array.set len 300000 - object 6.0664 ms/op 5.7659 ms/op 1.05
cachePermanentRootStruct no cache 3.3220 us/op 3.1350 us/op 1.06
cachePermanentRootStruct with cache 187.00 ns/op 190.00 ns/op 0.98
epochParticipation len 250000 rws 7813 2.4314 ms/op 2.3554 ms/op 1.03
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 4.7567 ms/op 4.5896 ms/op 1.04
BeaconState ViewDU batchHashTreeRoot vc=200000 mod=100000 213.60 ms/op 212.66 ms/op 1.00
BeaconState ViewDU batchHashTreeRoot - commit step vc=200000 mod=100000 181.10 ms/op 175.34 ms/op 1.03
BeaconState ViewDU batchHashTreeRoot - hash step vc=200000 mod=100000 49.920 ms/op 47.893 ms/op 1.04
BeaconState ViewDU hashTreeRoot() vc=200000 mod=100000 713.25 ms/op 682.79 ms/op 1.04
BeaconState ViewDU hashTreeRoot - commit step vc=200000 mod=100000 66.602 ms/op 62.858 ms/op 1.06
BeaconState ViewDU hashTreeRoot - validator tree creation vc=100000 mod=100000 275.33 ms/op 264.08 ms/op 1.04
deserialize Attestation - tree 3.5980 us/op 3.5800 us/op 1.01
deserialize Attestation - struct 1.9250 us/op 1.9190 us/op 1.00
deserialize Attestation - struct (reuse bytes) 1.4650 us/op 1.4660 us/op 1.00
deserialize SignedAggregateAndProof - tree 4.8330 us/op 4.6540 us/op 1.04
deserialize SignedAggregateAndProof - struct 2.9700 us/op 3.0110 us/op 0.99
deserialize SignedAggregateAndProof - struct (reuse bytes) 1.9010 us/op 1.8960 us/op 1.00
deserialize SyncCommitteeMessage - tree 1.4070 us/op 1.3820 us/op 1.02
deserialize SyncCommitteeMessage - struct 1.1070 us/op 1.0700 us/op 1.03
deserialize SyncCommitteeMessage - struct (reuse bytes) 761.00 ns/op 737.00 ns/op 1.03
deserialize SignedContributionAndProof - tree 2.8830 us/op 2.7780 us/op 1.04
deserialize SignedContributionAndProof - struct 2.2780 us/op 2.3140 us/op 0.98
deserialize SignedContributionAndProof - struct (reuse bytes) 1.2270 us/op 1.2230 us/op 1.00
deserialize SignedBeaconBlock - tree 275.80 us/op 269.57 us/op 1.02
deserialize SignedBeaconBlock - struct 122.81 us/op 121.31 us/op 1.01
deserialize SignedBeaconBlock - struct (reuse bytes) 76.599 us/op 77.650 us/op 0.99
BeaconState vc 300000 - deserialize tree 639.71 ms/op 623.88 ms/op 1.03
BeaconState vc 300000 - serialize tree 86.639 ms/op 92.651 ms/op 0.94
BeaconState.historicalRoots vc 300000 - deserialize tree 931.00 ns/op 925.00 ns/op 1.01
BeaconState.historicalRoots vc 300000 - serialize tree 678.00 ns/op 656.00 ns/op 1.03
BeaconState.validators vc 300000 - deserialize tree 602.09 ms/op 571.80 ms/op 1.05
BeaconState.validators vc 300000 - serialize tree 39.708 ms/op 35.698 ms/op 1.11
BeaconState.balances vc 300000 - deserialize tree 25.995 ms/op 28.095 ms/op 0.93
BeaconState.balances vc 300000 - serialize tree 3.5639 ms/op 3.5188 ms/op 1.01
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 913.31 us/op 870.58 us/op 1.05
BeaconState.previousEpochParticipation vc 300000 - serialize tree 328.86 us/op 324.11 us/op 1.01
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 917.28 us/op 880.92 us/op 1.04
BeaconState.currentEpochParticipation vc 300000 - serialize tree 324.90 us/op 322.89 us/op 1.01
BeaconState.inactivityScores vc 300000 - deserialize tree 28.374 ms/op 24.827 ms/op 1.14
BeaconState.inactivityScores vc 300000 - serialize tree 3.6167 ms/op 3.6257 ms/op 1.00
hashTreeRoot Attestation - struct 9.7250 us/op 9.2150 us/op 1.06
hashTreeRoot Attestation - tree 7.5190 us/op 7.4240 us/op 1.01
hashTreeRoot SignedAggregateAndProof - struct 12.715 us/op 12.275 us/op 1.04
hashTreeRoot SignedAggregateAndProof - tree 11.328 us/op 11.085 us/op 1.02
hashTreeRoot SyncCommitteeMessage - struct 3.1850 us/op 3.0230 us/op 1.05
hashTreeRoot SyncCommitteeMessage - tree 2.9000 us/op 2.7760 us/op 1.04
hashTreeRoot SignedContributionAndProof - struct 7.6920 us/op 7.4780 us/op 1.03
hashTreeRoot SignedContributionAndProof - tree 7.7200 us/op 7.6360 us/op 1.01
hashTreeRoot SignedBeaconBlock - struct 766.12 us/op 725.65 us/op 1.06
hashTreeRoot SignedBeaconBlock - tree 671.93 us/op 662.24 us/op 1.01
hashTreeRoot Validator - struct 4.4600 us/op 4.2590 us/op 1.05
hashTreeRoot Validator - tree 5.8380 us/op 5.7480 us/op 1.02
BeaconState vc 300000 - hashTreeRoot tree 1.9674 s/op 1.9695 s/op 1.00
BeaconState vc 300000 - batchHashTreeRoot tree 3.8900 s/op 3.8337 s/op 1.01
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 913.00 ns/op 821.00 ns/op 1.11
BeaconState.validators vc 300000 - hashTreeRoot tree 2.1478 s/op 2.0979 s/op 1.02
BeaconState.balances vc 300000 - hashTreeRoot tree 28.832 ms/op 28.348 ms/op 1.02
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 3.5353 ms/op 3.5386 ms/op 1.00
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 3.5221 ms/op 3.5385 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 28.910 ms/op 30.139 ms/op 0.96
hash64 x18 7.5350 us/op 7.3500 us/op 1.03
hashTwoObjects x18 7.4310 us/op 6.5890 us/op 1.13
hash64 x1740 645.59 us/op 631.65 us/op 1.02
hashTwoObjects x1740 609.73 us/op 590.06 us/op 1.03
hash64 x2700000 1.0109 s/op 979.43 ms/op 1.03
hashTwoObjects x2700000 942.65 ms/op 916.75 ms/op 1.03
get_exitEpoch - ContainerType 247.00 ns/op 261.00 ns/op 0.95
get_exitEpoch - ContainerNodeStructType 288.00 ns/op 269.00 ns/op 1.07
set_exitEpoch - ContainerType 249.00 ns/op 250.00 ns/op 1.00
set_exitEpoch - ContainerNodeStructType 246.00 ns/op 247.00 ns/op 1.00
get_pubkey - ContainerType 922.00 ns/op 891.00 ns/op 1.03
get_pubkey - ContainerNodeStructType 233.00 ns/op 236.00 ns/op 0.99
hashTreeRoot - ContainerType 448.00 ns/op 429.00 ns/op 1.04
hashTreeRoot - ContainerNodeStructType 428.00 ns/op 425.00 ns/op 1.01
createProof - ContainerType 3.4060 us/op 3.5820 us/op 0.95
createProof - ContainerNodeStructType 19.188 us/op 19.300 us/op 0.99
serialize - ContainerType 1.6160 us/op 1.6050 us/op 1.01
serialize - ContainerNodeStructType 1.1290 us/op 1.0970 us/op 1.03
set_exitEpoch_and_hashTreeRoot - ContainerType 2.7570 us/op 2.4020 us/op 1.15
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 6.3840 us/op 6.3980 us/op 1.00
doBatchHashTreeRootValidators 3.5860 us/op 3.5730 us/op 1.00
ContainerNodeStructViewDU hashTreeRoot 22.081 us/op 21.640 us/op 1.02
Array - for of 5.5280 us/op 9.0710 us/op 0.61
Array - for(;;) 5.4450 us/op 9.3490 us/op 0.58
basicListValue.readonlyValuesArray() 4.0640 ms/op 3.9874 ms/op 1.02
basicListValue.readonlyValuesArray() + loop all 4.3552 ms/op 4.3818 ms/op 0.99
compositeListValue.readonlyValuesArray() 31.078 ms/op 29.873 ms/op 1.04
compositeListValue.readonlyValuesArray() + loop all 30.991 ms/op 30.376 ms/op 1.02
Number64UintType - get balances list 4.3882 ms/op 4.3414 ms/op 1.01
Number64UintType - set balances list 10.134 ms/op 10.117 ms/op 1.00
Number64UintType - get and increase 10 then set 43.829 ms/op 37.387 ms/op 1.17
Number64UintType - increase 10 using applyDelta 16.314 ms/op 14.255 ms/op 1.14
Number64UintType - increase 10 using applyDeltaInBatch 16.380 ms/op 14.344 ms/op 1.14
tree_newTreeFromUint64Deltas 19.895 ms/op 20.980 ms/op 0.95
unsafeUint8ArrayToTree 37.489 ms/op 33.514 ms/op 1.12
bitLength(50) 269.00 ns/op 247.00 ns/op 1.09
bitLengthStr(50) 268.00 ns/op 213.00 ns/op 1.26
bitLength(8000) 241.00 ns/op 236.00 ns/op 1.02
bitLengthStr(8000) 285.00 ns/op 272.00 ns/op 1.05
bitLength(250000) 268.00 ns/op 229.00 ns/op 1.17
bitLengthStr(250000) 305.00 ns/op 321.00 ns/op 0.95
merkleize 32 chunks 12.965 us/op 12.575 us/op 1.03
merkleizeBlocksBytes 32 chunks 3.1230 us/op 3.0580 us/op 1.02
merkleizeBlockArray 32 chunks 6.0250 us/op 5.9560 us/op 1.01
merkleize 128 chunks 50.016 us/op 48.738 us/op 1.03
merkleizeBlocksBytes 128 chunks 7.3400 us/op 7.2760 us/op 1.01
merkleizeBlockArray 128 chunks 16.783 us/op 16.693 us/op 1.01
merkleize 512 chunks 198.98 us/op 194.37 us/op 1.02
merkleizeBlocksBytes 512 chunks 22.490 us/op 22.424 us/op 1.00
merkleizeBlockArray 512 chunks 57.915 us/op 57.437 us/op 1.01
merkleize 1024 chunks 402.32 us/op 388.75 us/op 1.03
merkleizeBlocksBytes 1024 chunks 42.521 us/op 42.484 us/op 1.00
merkleizeBlockArray 1024 chunks 112.67 us/op 111.92 us/op 1.01
floor - Math.floor (53) 1.2460 ns/op 1.2455 ns/op 1.00
floor - << 0 (53) 1.2469 ns/op 1.2445 ns/op 1.00
floor - Math.floor (512) 1.2472 ns/op 1.2444 ns/op 1.00
floor - << 0 (512) 1.2468 ns/op 1.2456 ns/op 1.00
fnIf(0) 1.5583 ns/op 1.5552 ns/op 1.00
fnSwitch(0) 2.1808 ns/op 2.1794 ns/op 1.00
fnObj(0) 1.5617 ns/op 1.5578 ns/op 1.00
fnArr(0) 1.5568 ns/op 1.5573 ns/op 1.00
fnIf(4) 2.1804 ns/op 2.1830 ns/op 1.00
fnSwitch(4) 2.1820 ns/op 2.1800 ns/op 1.00
fnObj(4) 1.5598 ns/op 1.5581 ns/op 1.00
fnArr(4) 1.5576 ns/op 1.5596 ns/op 1.00
fnIf(9) 3.1116 ns/op 3.1110 ns/op 1.00
fnSwitch(9) 2.1803 ns/op 2.1782 ns/op 1.00
fnObj(9) 1.5651 ns/op 1.5594 ns/op 1.00
fnArr(9) 1.5572 ns/op 1.5580 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.85 us/op 124.64 us/op 1.00
Container {a,b,vec} - as tree x100000 561.05 us/op 560.34 us/op 1.00
Container {a,vec,b} - as struct x100000 156.08 us/op 155.91 us/op 1.00
Container {a,vec,b} - as tree x100000 561.73 us/op 560.59 us/op 1.00
get 2 props x1000000 - rawObject 312.50 us/op 312.07 us/op 1.00
get 2 props x1000000 - proxy 72.560 ms/op 72.446 ms/op 1.00
get 2 props x1000000 - customObj 313.27 us/op 311.87 us/op 1.00
Simple object binary -> struct 626.00 ns/op 608.00 ns/op 1.03
Simple object binary -> tree_backed 1.6370 us/op 1.6070 us/op 1.02
Simple object struct -> tree_backed 2.1440 us/op 2.1160 us/op 1.01
Simple object tree_backed -> struct 1.5340 us/op 1.4860 us/op 1.03
Simple object struct -> binary 890.00 ns/op 859.00 ns/op 1.04
Simple object tree_backed -> binary 1.2130 us/op 1.2110 us/op 1.00
aggregationBits binary -> struct 511.00 ns/op 474.00 ns/op 1.08
aggregationBits binary -> tree_backed 2.1270 us/op 2.0430 us/op 1.04
aggregationBits struct -> tree_backed 2.4700 us/op 2.4470 us/op 1.01
aggregationBits tree_backed -> struct 981.00 ns/op 965.00 ns/op 1.02
aggregationBits struct -> binary 700.00 ns/op 694.00 ns/op 1.01
aggregationBits tree_backed -> binary 842.00 ns/op 824.00 ns/op 1.02
List(uint8) 100000 binary -> struct 983.67 us/op 989.10 us/op 0.99
List(uint8) 100000 binary -> tree_backed 271.64 us/op 266.49 us/op 1.02
List(uint8) 100000 struct -> tree_backed 1.3247 ms/op 1.3083 ms/op 1.01
List(uint8) 100000 tree_backed -> struct 954.63 us/op 955.94 us/op 1.00
List(uint8) 100000 struct -> binary 1.0539 ms/op 1.0490 ms/op 1.00
List(uint8) 100000 tree_backed -> binary 107.84 us/op 107.46 us/op 1.00
List(uint64Number) 100000 binary -> struct 1.2460 ms/op 1.2471 ms/op 1.00
List(uint64Number) 100000 binary -> tree_backed 4.3497 ms/op 4.1656 ms/op 1.04
List(uint64Number) 100000 struct -> tree_backed 22.828 ms/op 6.1502 ms/op 3.71
List(uint64Number) 100000 tree_backed -> struct 2.2399 ms/op 2.2902 ms/op 0.98
List(uint64Number) 100000 struct -> binary 1.4223 ms/op 1.3964 ms/op 1.02
List(uint64Number) 100000 tree_backed -> binary 953.58 us/op 1.0192 ms/op 0.94
List(Uint64Bigint) 100000 binary -> struct 3.4964 ms/op 3.6155 ms/op 0.97
List(Uint64Bigint) 100000 binary -> tree_backed 4.3030 ms/op 4.3767 ms/op 0.98
List(Uint64Bigint) 100000 struct -> tree_backed 6.6897 ms/op 6.9597 ms/op 0.96
List(Uint64Bigint) 100000 tree_backed -> struct 4.8296 ms/op 4.5863 ms/op 1.05
List(Uint64Bigint) 100000 struct -> binary 2.1158 ms/op 2.0919 ms/op 1.01
List(Uint64Bigint) 100000 tree_backed -> binary 1.0984 ms/op 1.0588 ms/op 1.04
Vector(Root) 100000 binary -> struct 36.577 ms/op 32.616 ms/op 1.12
Vector(Root) 100000 binary -> tree_backed 34.487 ms/op 30.839 ms/op 1.12
Vector(Root) 100000 struct -> tree_backed 51.166 ms/op 47.758 ms/op 1.07
Vector(Root) 100000 tree_backed -> struct 49.830 ms/op 48.017 ms/op 1.04
Vector(Root) 100000 struct -> binary 3.0503 ms/op 2.9848 ms/op 1.02
Vector(Root) 100000 tree_backed -> binary 6.0754 ms/op 6.1972 ms/op 0.98
List(Validator) 100000 binary -> struct 110.74 ms/op 98.371 ms/op 1.13
List(Validator) 100000 binary -> tree_backed 346.44 ms/op 307.81 ms/op 1.13
List(Validator) 100000 struct -> tree_backed 373.19 ms/op 354.49 ms/op 1.05
List(Validator) 100000 tree_backed -> struct 218.01 ms/op 209.39 ms/op 1.04
List(Validator) 100000 struct -> binary 29.748 ms/op 29.985 ms/op 0.99
List(Validator) 100000 tree_backed -> binary 112.82 ms/op 107.83 ms/op 1.05
List(Validator-NS) 100000 binary -> struct 101.00 ms/op 98.614 ms/op 1.02
List(Validator-NS) 100000 binary -> tree_backed 146.90 ms/op 149.43 ms/op 0.98
List(Validator-NS) 100000 struct -> tree_backed 180.12 ms/op 182.02 ms/op 0.99
List(Validator-NS) 100000 tree_backed -> struct 149.02 ms/op 148.83 ms/op 1.00
List(Validator-NS) 100000 struct -> binary 7.2639 ms/op 7.8260 ms/op 0.93
List(Validator-NS) 100000 tree_backed -> binary 12.738 ms/op 12.255 ms/op 1.04
get epochStatuses - MutableVector 110.97 us/op 98.454 us/op 1.13
get epochStatuses - ViewDU 215.76 us/op 177.94 us/op 1.21
set epochStatuses - ListTreeView 2.1277 ms/op 2.0582 ms/op 1.03
set epochStatuses - ListTreeView - set() 469.21 us/op 444.86 us/op 1.05
set epochStatuses - ListTreeView - commit() 800.10 us/op 783.67 us/op 1.02
bitstring 511.19 ns/op 509.82 ns/op 1.00
bit mask 13.935 ns/op 13.452 ns/op 1.04
struct - increase slot to 1000000 934.64 us/op 933.96 us/op 1.00
UintNumberType - increase slot to 1000000 27.734 ms/op 27.865 ms/op 1.00
UintBigintType - increase slot to 1000000 174.17 ms/op 166.38 ms/op 1.05
UintBigint8 x 100000 tree_deserialize 5.6042 ms/op 5.5161 ms/op 1.02
UintBigint8 x 100000 tree_serialize 1.1355 ms/op 1.1297 ms/op 1.01
UintBigint16 x 100000 tree_deserialize 5.6776 ms/op 5.6109 ms/op 1.01
UintBigint16 x 100000 tree_serialize 1.3801 ms/op 1.3324 ms/op 1.04
UintBigint32 x 100000 tree_deserialize 5.5402 ms/op 5.4576 ms/op 1.02
UintBigint32 x 100000 tree_serialize 1.8432 ms/op 1.6808 ms/op 1.10
UintBigint64 x 100000 tree_deserialize 6.7334 ms/op 6.2629 ms/op 1.08
UintBigint64 x 100000 tree_serialize 2.5370 ms/op 1.6767 ms/op 1.51
UintBigint8 x 100000 value_deserialize 406.42 us/op 405.29 us/op 1.00
UintBigint8 x 100000 value_serialize 760.96 us/op 743.36 us/op 1.02
UintBigint16 x 100000 value_deserialize 467.38 us/op 467.13 us/op 1.00
UintBigint16 x 100000 value_serialize 798.09 us/op 781.99 us/op 1.02
UintBigint32 x 100000 value_deserialize 498.39 us/op 498.10 us/op 1.00
UintBigint32 x 100000 value_serialize 838.33 us/op 824.02 us/op 1.02
UintBigint64 x 100000 value_deserialize 531.16 us/op 531.68 us/op 1.00
UintBigint64 x 100000 value_serialize 980.96 us/op 960.18 us/op 1.02
UintBigint8 x 100000 deserialize 3.1413 ms/op 3.0531 ms/op 1.03
UintBigint8 x 100000 serialize 1.5606 ms/op 1.5097 ms/op 1.03
UintBigint16 x 100000 deserialize 3.6114 ms/op 3.0698 ms/op 1.18
UintBigint16 x 100000 serialize 1.6174 ms/op 1.5930 ms/op 1.02
UintBigint32 x 100000 deserialize 3.3404 ms/op 3.1287 ms/op 1.07
UintBigint32 x 100000 serialize 2.7803 ms/op 2.8248 ms/op 0.98
UintBigint64 x 100000 deserialize 4.1655 ms/op 3.8174 ms/op 1.09
UintBigint64 x 100000 serialize 1.6737 ms/op 1.6565 ms/op 1.01
UintBigint128 x 100000 deserialize 5.8794 ms/op 5.4874 ms/op 1.07
UintBigint128 x 100000 serialize 14.960 ms/op 14.809 ms/op 1.01
UintBigint256 x 100000 deserialize 8.3620 ms/op 8.4498 ms/op 0.99
UintBigint256 x 100000 serialize 43.815 ms/op 44.416 ms/op 0.99
Slice from Uint8Array x25000 1.3360 ms/op 1.3078 ms/op 1.02
Slice from ArrayBuffer x25000 16.070 ms/op 15.603 ms/op 1.03
Slice from ArrayBuffer x25000 + new Uint8Array 17.678 ms/op 15.565 ms/op 1.14
Copy Uint8Array 100000 iterate 1.6698 ms/op 1.6744 ms/op 1.00
Copy Uint8Array 100000 slice 109.67 us/op 96.492 us/op 1.14
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 110.08 us/op 98.231 us/op 1.12
Copy Buffer 100000 Uint8Array.prototype.slice.call 110.52 us/op 97.004 us/op 1.14
Copy Uint8Array 100000 slice + set 222.44 us/op 193.96 us/op 1.15
Copy Uint8Array 100000 subarray + set 107.35 us/op 97.334 us/op 1.10
Copy Uint8Array 100000 slice arrayBuffer 107.94 us/op 97.246 us/op 1.11
Uint64 deserialize 100000 - iterate Uint8Array 1.9272 ms/op 1.9144 ms/op 1.01
Uint64 deserialize 100000 - by Uint32A 1.8970 ms/op 1.8379 ms/op 1.03
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.9234 ms/op 1.8307 ms/op 1.05
Uint64 deserialize 100000 - by DataView.getBigUint64 4.8334 ms/op 4.9276 ms/op 0.98
Uint64 deserialize 100000 - by byte 40.349 ms/op 40.441 ms/op 1.00

by benchmarkbot/action

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.

1 participant