Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: add optional ssz type #329

Merged
merged 6 commits into from
Sep 9, 2023
Merged

feat: add optional ssz type #329

merged 6 commits into from
Sep 9, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Aug 27, 2023

implement PR:

requirement to build verkle types as the kaustenine network (and its relaunch will use optional types)

@g11tech g11tech requested a review from a team as a code owner August 27, 2023 08:50
@github-actions github-actions bot added the ssz label Aug 27, 2023
@github-actions
Copy link

github-actions bot commented Aug 27, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a500a62 Previous: 2929e8b Ratio
digestTwoHashObjects 50023 times 57.674 ms/op 60.155 ms/op 0.96
digest64 50023 times 60.324 ms/op 62.455 ms/op 0.97
digest 50023 times 60.203 ms/op 62.483 ms/op 0.96
input length 32 1.4950 us/op 1.5150 us/op 0.99
input length 64 1.6170 us/op 1.6850 us/op 0.96
input length 128 2.7800 us/op 2.8640 us/op 0.97
input length 256 4.0780 us/op 4.2160 us/op 0.97
input length 512 6.7700 us/op 7.0390 us/op 0.96
input length 1024 13.509 us/op 13.666 us/op 0.99
digest 1000000 times 1.0502 s/op 1.0704 s/op 0.98
hashObjectToByteArray 50023 times 2.7355 ms/op 2.7336 ms/op 1.00
byteArrayToHashObject 50023 times 2.7272 ms/op 2.8542 ms/op 0.96
getGindicesAtDepth 6.2040 us/op 6.2310 us/op 1.00
iterateAtDepth 13.142 us/op 12.804 us/op 1.03
getGindexBits 582.00 ns/op 566.00 ns/op 1.03
gindexIterator 1.2110 us/op 1.2220 us/op 0.99
hash 2 Uint8Array 2250026 times - as-sha256 2.7543 s/op 2.7703 s/op 0.99
hashTwoObjects 2250026 times - as-sha256 2.6171 s/op 2.6317 s/op 0.99
hash 2 Uint8Array 2250026 times - noble 7.2005 s/op 7.2653 s/op 0.99
hashTwoObjects 2250026 times - noble 10.784 s/op 11.096 s/op 0.97
getNodeH() x7812.5 avg hindex 25.879 us/op 25.868 us/op 1.00
getNodeH() x7812.5 index 0 10.910 us/op 11.026 us/op 0.99
getNodeH() x7812.5 index 7 10.915 us/op 10.911 us/op 1.00
getNodeH() x7812.5 index 7 with key array 10.938 us/op 10.913 us/op 1.00
new LeafNode() x7812.5 199.58 us/op 200.74 us/op 0.99
multiproof - depth 15, 1 requested leaves 13.890 us/op 14.113 us/op 0.98
tree offset multiproof - depth 15, 1 requested leaves 30.923 us/op 31.728 us/op 0.97
compact multiproof - depth 15, 1 requested leaves 8.9480 us/op 9.4610 us/op 0.95
multiproof - depth 15, 2 requested leaves 20.502 us/op 21.918 us/op 0.94
tree offset multiproof - depth 15, 2 requested leaves 35.979 us/op 37.912 us/op 0.95
compact multiproof - depth 15, 2 requested leaves 4.9730 us/op 5.2330 us/op 0.95
multiproof - depth 15, 3 requested leaves 28.641 us/op 29.431 us/op 0.97
tree offset multiproof - depth 15, 3 requested leaves 47.306 us/op 49.528 us/op 0.96
compact multiproof - depth 15, 3 requested leaves 8.8420 us/op 9.3890 us/op 0.94
multiproof - depth 15, 4 requested leaves 38.833 us/op 39.461 us/op 0.98
tree offset multiproof - depth 15, 4 requested leaves 62.612 us/op 60.461 us/op 1.04
compact multiproof - depth 15, 4 requested leaves 8.9400 us/op 9.4540 us/op 0.95
packedRootsBytesToLeafNodes bytes 4000 offset 0 3.6150 us/op 3.9630 us/op 0.91
packedRootsBytesToLeafNodes bytes 4000 offset 1 3.5530 us/op 4.0770 us/op 0.87
packedRootsBytesToLeafNodes bytes 4000 offset 2 3.5150 us/op 3.9900 us/op 0.88
packedRootsBytesToLeafNodes bytes 4000 offset 3 3.5400 us/op 4.0180 us/op 0.88
subtreeFillToContents depth 40 count 250000 86.098 ms/op 92.509 ms/op 0.93
setRoot - gindexBitstring 14.164 ms/op 17.242 ms/op 0.82
setRoot - gindex 14.467 ms/op 16.535 ms/op 0.87
getRoot - gindexBitstring 4.2571 ms/op 4.2109 ms/op 1.01
getRoot - gindex 4.5153 ms/op 4.6134 ms/op 0.98
getHashObject then setHashObject 16.319 ms/op 18.198 ms/op 0.90
setNodeWithFn 14.246 ms/op 15.290 ms/op 0.93
getNodeAtDepth depth 0 x100000 2.3870 ms/op 2.3190 ms/op 1.03
setNodeAtDepth depth 0 x100000 4.4018 ms/op 4.7762 ms/op 0.92
getNodesAtDepth depth 0 x100000 2.0684 ms/op 2.0937 ms/op 0.99
setNodesAtDepth depth 0 x100000 2.7405 ms/op 2.7988 ms/op 0.98
getNodeAtDepth depth 1 x100000 2.5156 ms/op 2.5130 ms/op 1.00
setNodeAtDepth depth 1 x100000 9.7311 ms/op 10.227 ms/op 0.95
getNodesAtDepth depth 1 x100000 2.3885 ms/op 2.3984 ms/op 1.00
setNodesAtDepth depth 1 x100000 8.0182 ms/op 8.3843 ms/op 0.96
getNodeAtDepth depth 2 x100000 3.1973 ms/op 3.1734 ms/op 1.01
setNodeAtDepth depth 2 x100000 15.733 ms/op 17.028 ms/op 0.92
getNodesAtDepth depth 2 x100000 30.852 ms/op 29.322 ms/op 1.05
setNodesAtDepth depth 2 x100000 21.511 ms/op 22.437 ms/op 0.96
tree.getNodesAtDepth - gindexes 9.5655 ms/op 9.8833 ms/op 0.97
tree.getNodesAtDepth - push all nodes 2.7520 ms/op 2.7735 ms/op 0.99
tree.getNodesAtDepth - navigation 168.11 us/op 169.26 us/op 0.99
tree.setNodesAtDepth - indexes 558.38 us/op 598.80 us/op 0.93
set at depth 8 714.00 ns/op 739.00 ns/op 0.97
set at depth 16 1.0040 us/op 1.0010 us/op 1.00
set at depth 32 1.5110 us/op 1.6870 us/op 0.90
iterateNodesAtDepth 8 256 23.945 us/op 24.805 us/op 0.97
getNodesAtDepth 8 256 6.4810 us/op 6.6450 us/op 0.98
iterateNodesAtDepth 16 65536 7.1575 ms/op 7.2028 ms/op 0.99
getNodesAtDepth 16 65536 2.7605 ms/op 2.6705 ms/op 1.03
iterateNodesAtDepth 32 250000 26.530 ms/op 26.528 ms/op 1.00
getNodesAtDepth 32 250000 8.1073 ms/op 7.9147 ms/op 1.02
iterateNodesAtDepth 40 250000 26.609 ms/op 26.898 ms/op 0.99
getNodesAtDepth 40 250000 8.3685 ms/op 7.9145 ms/op 1.06
250k validators 11.334 s/op 11.826 s/op 0.96
bitlist bytes to struct (120,90) 1.2290 us/op 773.00 ns/op 1.59
bitlist bytes to tree (120,90) 3.6780 us/op 3.6420 us/op 1.01
bitlist bytes to struct (2048,2048) 1.8000 us/op 1.8030 us/op 1.00
bitlist bytes to tree (2048,2048) 6.6030 us/op 6.3580 us/op 1.04
ByteListType - deserialize 16.046 ms/op 17.745 ms/op 0.90
BasicListType - deserialize 16.388 ms/op 14.907 ms/op 1.10
ByteListType - serialize 16.807 ms/op 17.117 ms/op 0.98
BasicListType - serialize 19.684 ms/op 19.865 ms/op 0.99
BasicListType - tree_convertToStruct 40.216 ms/op 39.211 ms/op 1.03
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.7548 ms/op 6.7392 ms/op 0.85
List[uint8, 68719476736] len 300000 ViewDU.get(i) 6.7914 ms/op 6.7931 ms/op 1.00
Array.push len 300000 empty Array - number 8.7795 ms/op 9.0716 ms/op 0.97
Array.set len 300000 from new Array - number 2.2336 ms/op 2.2853 ms/op 0.98
Array.set len 300000 - number 7.9402 ms/op 8.0704 ms/op 0.98
Uint8Array.set len 300000 252.66 us/op 259.07 us/op 0.98
Uint32Array.set len 300000 387.21 us/op 395.30 us/op 0.98
Container({a: uint8, b: uint8}) getViewDU x300000 32.614 ms/op 35.924 ms/op 0.91
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 13.319 ms/op 12.781 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 392.20 ms/op 390.16 ms/op 1.01
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 443.36 ms/op 450.90 ms/op 0.98
List(Container) len 300000 ViewDU.get(i) 10.713 ms/op 12.077 ms/op 0.89
List(Container) len 300000 ViewDU.getReadonly(i) 10.208 ms/op 11.687 ms/op 0.87
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 55.906 ms/op 60.526 ms/op 0.92
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 8.4812 ms/op 9.4224 ms/op 0.90
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 9.9534 ms/op 11.269 ms/op 0.88
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 9.6628 ms/op 11.357 ms/op 0.85
Array.push len 300000 empty Array - object 8.3532 ms/op 8.5972 ms/op 0.97
Array.set len 300000 from new Array - object 2.7576 ms/op 2.7041 ms/op 1.02
Array.set len 300000 - object 8.5822 ms/op 8.4605 ms/op 1.01
cachePermanentRootStruct no cache 12.300 us/op 12.142 us/op 1.01
cachePermanentRootStruct with cache 293.00 ns/op 325.00 ns/op 0.90
epochParticipation len 250000 rws 7813 3.2940 ms/op 3.3398 ms/op 0.99
deserialize Attestation - tree 4.3210 us/op 4.2470 us/op 1.02
deserialize Attestation - struct 2.9240 us/op 2.8780 us/op 1.02
deserialize SignedAggregateAndProof - tree 5.5600 us/op 5.4800 us/op 1.01
deserialize SignedAggregateAndProof - struct 4.7380 us/op 4.6190 us/op 1.03
deserialize SyncCommitteeMessage - tree 1.5030 us/op 1.5170 us/op 0.99
deserialize SyncCommitteeMessage - struct 1.7340 us/op 1.7740 us/op 0.98
deserialize SignedContributionAndProof - tree 2.7670 us/op 2.8350 us/op 0.98
deserialize SignedContributionAndProof - struct 4.2290 us/op 3.9910 us/op 1.06
deserialize SignedBeaconBlock - tree 308.30 us/op 323.90 us/op 0.95
deserialize SignedBeaconBlock - struct 215.02 us/op 207.14 us/op 1.04
BeaconState vc 300000 - deserialize tree 1.0310 s/op 1.0775 s/op 0.96
BeaconState vc 300000 - serialize tree 315.39 ms/op 344.13 ms/op 0.92
BeaconState.historicalRoots vc 300000 - deserialize tree 1.1070 us/op 1.1720 us/op 0.94
BeaconState.historicalRoots vc 300000 - serialize tree 1.2280 us/op 1.2080 us/op 1.02
BeaconState.validators vc 300000 - deserialize tree 990.80 ms/op 1.0154 s/op 0.98
BeaconState.validators vc 300000 - serialize tree 259.72 ms/op 284.77 ms/op 0.91
BeaconState.balances vc 300000 - deserialize tree 39.264 ms/op 39.554 ms/op 0.99
BeaconState.balances vc 300000 - serialize tree 5.6498 ms/op 5.8460 ms/op 0.97
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 700.76 us/op 809.23 us/op 0.87
BeaconState.previousEpochParticipation vc 300000 - serialize tree 472.83 us/op 476.35 us/op 0.99
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 789.43 us/op 759.59 us/op 1.04
BeaconState.currentEpochParticipation vc 300000 - serialize tree 468.59 us/op 473.54 us/op 0.99
BeaconState.inactivityScores vc 300000 - deserialize tree 41.267 ms/op 45.434 ms/op 0.91
BeaconState.inactivityScores vc 300000 - serialize tree 5.9185 ms/op 5.0744 ms/op 1.17
hashTreeRoot Attestation - struct 42.507 us/op 36.648 us/op 1.16
hashTreeRoot Attestation - tree 27.303 us/op 24.645 us/op 1.11
hashTreeRoot SignedAggregateAndProof - struct 61.999 us/op 51.741 us/op 1.20
hashTreeRoot SignedAggregateAndProof - tree 34.631 us/op 34.172 us/op 1.01
hashTreeRoot SyncCommitteeMessage - struct 14.301 us/op 12.263 us/op 1.17
hashTreeRoot SyncCommitteeMessage - tree 7.6200 us/op 7.6120 us/op 1.00
hashTreeRoot SignedContributionAndProof - struct 43.459 us/op 34.744 us/op 1.25
hashTreeRoot SignedContributionAndProof - tree 26.070 us/op 24.604 us/op 1.06
hashTreeRoot SignedBeaconBlock - struct 3.6713 ms/op 3.0566 ms/op 1.20
hashTreeRoot SignedBeaconBlock - tree 2.0316 ms/op 2.0403 ms/op 1.00
hashTreeRoot Validator - struct 17.682 us/op 17.147 us/op 1.03
hashTreeRoot Validator - tree 15.087 us/op 13.849 us/op 1.09
BeaconState vc 300000 - hashTreeRoot tree 4.6521 s/op 4.6356 s/op 1.00
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.8360 us/op 1.8960 us/op 0.97
BeaconState.validators vc 300000 - hashTreeRoot tree 4.3271 s/op 4.4016 s/op 0.98
BeaconState.balances vc 300000 - hashTreeRoot tree 102.39 ms/op 103.86 ms/op 0.99
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 11.060 ms/op 11.051 ms/op 1.00
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 11.057 ms/op 11.056 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 102.78 ms/op 105.18 ms/op 0.98
hash64 x18 24.571 us/op 24.415 us/op 1.01
hashTwoObjects x18 21.946 us/op 22.014 us/op 1.00
hash64 x1740 2.3132 ms/op 2.3098 ms/op 1.00
hashTwoObjects x1740 2.0801 ms/op 2.0727 ms/op 1.00
hash64 x2700000 3.5932 s/op 3.5867 s/op 1.00
hashTwoObjects x2700000 3.2182 s/op 3.2111 s/op 1.00
get_exitEpoch - ContainerType 498.00 ns/op 476.00 ns/op 1.05
get_exitEpoch - ContainerNodeStructType 423.00 ns/op 398.00 ns/op 1.06
set_exitEpoch - ContainerType 468.00 ns/op 422.00 ns/op 1.11
set_exitEpoch - ContainerNodeStructType 305.00 ns/op 296.00 ns/op 1.03
get_pubkey - ContainerType 1.5650 us/op 1.5070 us/op 1.04
get_pubkey - ContainerNodeStructType 298.00 ns/op 299.00 ns/op 1.00
hashTreeRoot - ContainerType 512.00 ns/op 486.00 ns/op 1.05
hashTreeRoot - ContainerNodeStructType 570.00 ns/op 559.00 ns/op 1.02
createProof - ContainerType 6.4400 us/op 6.4110 us/op 1.00
createProof - ContainerNodeStructType 34.764 us/op 35.255 us/op 0.99
serialize - ContainerType 2.7980 us/op 2.7850 us/op 1.00
serialize - ContainerNodeStructType 2.3010 us/op 2.2450 us/op 1.02
set_exitEpoch_and_hashTreeRoot - ContainerType 5.6340 us/op 5.3140 us/op 1.06
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 15.230 us/op 14.918 us/op 1.02
Array - for of 12.300 us/op 17.475 us/op 0.70
Array - for(;;) 8.9010 us/op 15.594 us/op 0.57
basicListValue.readonlyValuesArray() 5.7184 ms/op 5.5187 ms/op 1.04
basicListValue.readonlyValuesArray() + loop all 5.7701 ms/op 5.6088 ms/op 1.03
compositeListValue.readonlyValuesArray() 55.478 ms/op 45.310 ms/op 1.22
compositeListValue.readonlyValuesArray() + loop all 54.287 ms/op 33.779 ms/op 1.61
Number64UintType - get balances list 6.2706 ms/op 6.8618 ms/op 0.91
Number64UintType - set balances list 16.493 ms/op 13.627 ms/op 1.21
Number64UintType - get and increase 10 then set 59.804 ms/op 61.171 ms/op 0.98
Number64UintType - increase 10 using applyDelta 25.929 ms/op 26.101 ms/op 0.99
Number64UintType - increase 10 using applyDeltaInBatch 25.688 ms/op 26.364 ms/op 0.97
tree_newTreeFromUint64Deltas 26.712 ms/op 30.782 ms/op 0.87
unsafeUint8ArrayToTree 48.119 ms/op 49.071 ms/op 0.98
bitLength(50) 311.00 ns/op 304.00 ns/op 1.02
bitLengthStr(50) 359.00 ns/op 354.00 ns/op 1.01
bitLength(8000) 300.00 ns/op 293.00 ns/op 1.02
bitLengthStr(8000) 501.00 ns/op 487.00 ns/op 1.03
bitLength(250000) 298.00 ns/op 296.00 ns/op 1.01
bitLengthStr(250000) 585.00 ns/op 598.00 ns/op 0.98
floor - Math.floor (53) 0.66997 ns/op 0.66962 ns/op 1.00
floor - << 0 (53) 0.66974 ns/op 0.66963 ns/op 1.00
floor - Math.floor (512) 0.66965 ns/op 0.67044 ns/op 1.00
floor - << 0 (512) 0.67065 ns/op 0.66968 ns/op 1.00
fnIf(0) 3.0128 ns/op 3.0129 ns/op 1.00
fnSwitch(0) 5.0197 ns/op 5.0199 ns/op 1.00
fnObj(0) 0.66992 ns/op 0.66986 ns/op 1.00
fnArr(0) 0.66958 ns/op 0.66964 ns/op 1.00
fnIf(4) 4.3517 ns/op 4.3508 ns/op 1.00
fnSwitch(4) 5.0197 ns/op 5.0207 ns/op 1.00
fnObj(4) 0.66982 ns/op 0.66966 ns/op 1.00
fnArr(4) 0.66966 ns/op 0.66966 ns/op 1.00
fnIf(9) 6.6926 ns/op 6.6941 ns/op 1.00
fnSwitch(9) 5.0239 ns/op 5.0208 ns/op 1.00
fnObj(9) 0.66968 ns/op 0.66983 ns/op 1.00
fnArr(9) 0.66973 ns/op 0.66966 ns/op 1.00
Container {a,b,vec} - as struct x100000 67.376 us/op 67.339 us/op 1.00
Container {a,b,vec} - as tree x100000 837.16 us/op 836.99 us/op 1.00
Container {a,vec,b} - as struct x100000 100.94 us/op 100.82 us/op 1.00
Container {a,vec,b} - as tree x100000 904.01 us/op 903.91 us/op 1.00
get 2 props x1000000 - rawObject 335.12 us/op 335.08 us/op 1.00
get 2 props x1000000 - proxy 145.11 ms/op 144.70 ms/op 1.00
get 2 props x1000000 - customObj 335.20 us/op 335.17 us/op 1.00
Simple object binary -> struct 905.00 ns/op 886.00 ns/op 1.02
Simple object binary -> tree_backed 2.7940 us/op 2.7460 us/op 1.02
Simple object struct -> tree_backed 3.7720 us/op 3.6330 us/op 1.04
Simple object tree_backed -> struct 2.9970 us/op 2.9890 us/op 1.00
Simple object struct -> binary 1.5560 us/op 1.4750 us/op 1.05
Simple object tree_backed -> binary 2.5060 us/op 2.5590 us/op 0.98
aggregationBits binary -> struct 910.00 ns/op 851.00 ns/op 1.07
aggregationBits binary -> tree_backed 3.7430 us/op 3.6200 us/op 1.03
aggregationBits struct -> tree_backed 4.4850 us/op 4.4170 us/op 1.02
aggregationBits tree_backed -> struct 1.8540 us/op 1.7780 us/op 1.04
aggregationBits struct -> binary 1.3450 us/op 1.2560 us/op 1.07
aggregationBits tree_backed -> binary 1.7110 us/op 1.5830 us/op 1.08
List(uint8) 100000 binary -> struct 2.0804 ms/op 2.0302 ms/op 1.02
List(uint8) 100000 binary -> tree_backed 162.79 us/op 177.29 us/op 0.92
List(uint8) 100000 struct -> tree_backed 2.4689 ms/op 2.3926 ms/op 1.03
List(uint8) 100000 tree_backed -> struct 1.6065 ms/op 1.6111 ms/op 1.00
List(uint8) 100000 struct -> binary 2.2797 ms/op 2.1975 ms/op 1.04
List(uint8) 100000 tree_backed -> binary 147.57 us/op 146.21 us/op 1.01
List(uint64Number) 100000 binary -> struct 1.8589 ms/op 1.8639 ms/op 1.00
List(uint64Number) 100000 binary -> tree_backed 5.1662 ms/op 5.5747 ms/op 0.93
List(uint64Number) 100000 struct -> tree_backed 7.9093 ms/op 8.3186 ms/op 0.95
List(uint64Number) 100000 tree_backed -> struct 3.2187 ms/op 3.3940 ms/op 0.95
List(uint64Number) 100000 struct -> binary 2.6989 ms/op 2.7370 ms/op 0.99
List(uint64Number) 100000 tree_backed -> binary 1.5325 ms/op 1.6135 ms/op 0.95
List(Uint64Bigint) 100000 binary -> struct 5.6289 ms/op 5.6345 ms/op 1.00
List(Uint64Bigint) 100000 binary -> tree_backed 6.1747 ms/op 6.4176 ms/op 0.96
List(Uint64Bigint) 100000 struct -> tree_backed 9.3631 ms/op 10.015 ms/op 0.93
List(Uint64Bigint) 100000 tree_backed -> struct 7.0446 ms/op 7.0410 ms/op 1.00
List(Uint64Bigint) 100000 struct -> binary 3.4254 ms/op 3.3698 ms/op 1.02
List(Uint64Bigint) 100000 tree_backed -> binary 1.3990 ms/op 1.5509 ms/op 0.90
Vector(Root) 100000 binary -> struct 49.143 ms/op 57.636 ms/op 0.85
Vector(Root) 100000 binary -> tree_backed 52.564 ms/op 58.578 ms/op 0.90
Vector(Root) 100000 struct -> tree_backed 67.929 ms/op 69.724 ms/op 0.97
Vector(Root) 100000 tree_backed -> struct 77.658 ms/op 65.503 ms/op 1.19
Vector(Root) 100000 struct -> binary 3.4908 ms/op 3.4123 ms/op 1.02
Vector(Root) 100000 tree_backed -> binary 14.475 ms/op 14.778 ms/op 0.98
List(Validator) 100000 binary -> struct 188.49 ms/op 199.06 ms/op 0.95
List(Validator) 100000 binary -> tree_backed 487.05 ms/op 531.68 ms/op 0.92
List(Validator) 100000 struct -> tree_backed 543.65 ms/op 579.23 ms/op 0.94
List(Validator) 100000 tree_backed -> struct 323.01 ms/op 335.99 ms/op 0.96
List(Validator) 100000 struct -> binary 50.905 ms/op 51.274 ms/op 0.99
List(Validator) 100000 tree_backed -> binary 135.51 ms/op 146.34 ms/op 0.93
List(Validator-NS) 100000 binary -> struct 202.65 ms/op 212.67 ms/op 0.95
List(Validator-NS) 100000 binary -> tree_backed 272.14 ms/op 279.53 ms/op 0.97
List(Validator-NS) 100000 struct -> tree_backed 338.49 ms/op 354.11 ms/op 0.96
List(Validator-NS) 100000 tree_backed -> struct 281.59 ms/op 300.60 ms/op 0.94
List(Validator-NS) 100000 struct -> binary 51.706 ms/op 52.002 ms/op 0.99
List(Validator-NS) 100000 tree_backed -> binary 57.668 ms/op 59.415 ms/op 0.97
get epochStatuses - MutableVector 143.07 us/op 143.40 us/op 1.00
get epochStatuses - ViewDU 292.80 us/op 290.36 us/op 1.01
set epochStatuses - ListTreeView 2.1847 ms/op 2.2537 ms/op 0.97
set epochStatuses - ListTreeView - set() 632.86 us/op 614.79 us/op 1.03
set epochStatuses - ListTreeView - commit() 747.01 us/op 692.35 us/op 1.08
bitstring 793.97 ns/op 753.98 ns/op 1.05
bit mask 12.759 ns/op 12.811 ns/op 1.00
struct - increase slot to 1000000 2.1862 ms/op 2.1850 ms/op 1.00
UintNumberType - increase slot to 1000000 50.182 ms/op 49.302 ms/op 1.02
UintBigintType - increase slot to 1000000 613.16 ms/op 649.68 ms/op 0.94
UintBigint8 x 100000 tree_deserialize 6.7406 ms/op 7.0116 ms/op 0.96
UintBigint8 x 100000 tree_serialize 2.2634 ms/op 2.2607 ms/op 1.00
UintBigint16 x 100000 tree_deserialize 6.1390 ms/op 6.2047 ms/op 0.99
UintBigint16 x 100000 tree_serialize 2.1366 ms/op 2.1924 ms/op 0.97
UintBigint32 x 100000 tree_deserialize 7.6677 ms/op 7.8579 ms/op 0.98
UintBigint32 x 100000 tree_serialize 2.0057 ms/op 2.0771 ms/op 0.97
UintBigint64 x 100000 tree_deserialize 8.2372 ms/op 8.6206 ms/op 0.96
UintBigint64 x 100000 tree_serialize 2.7244 ms/op 2.7637 ms/op 0.99
UintBigint8 x 100000 value_deserialize 870.36 us/op 870.65 us/op 1.00
UintBigint8 x 100000 value_serialize 1.1842 ms/op 1.3107 ms/op 0.90
UintBigint16 x 100000 value_deserialize 933.23 us/op 918.64 us/op 1.02
UintBigint16 x 100000 value_serialize 1.2200 ms/op 1.3746 ms/op 0.89
UintBigint32 x 100000 value_deserialize 837.06 us/op 836.98 us/op 1.00
UintBigint32 x 100000 value_serialize 1.2454 ms/op 1.3678 ms/op 0.91
UintBigint64 x 100000 value_deserialize 949.40 us/op 950.33 us/op 1.00
UintBigint64 x 100000 value_serialize 1.5620 ms/op 1.6793 ms/op 0.93
UintBigint8 x 100000 deserialize 6.8671 ms/op 7.0690 ms/op 0.97
UintBigint8 x 100000 serialize 2.6508 ms/op 2.6039 ms/op 1.02
UintBigint16 x 100000 deserialize 6.7955 ms/op 7.2065 ms/op 0.94
UintBigint16 x 100000 serialize 2.6311 ms/op 2.5644 ms/op 1.03
UintBigint32 x 100000 deserialize 8.0783 ms/op 8.4345 ms/op 0.96
UintBigint32 x 100000 serialize 4.5299 ms/op 4.3565 ms/op 1.04
UintBigint64 x 100000 deserialize 5.8629 ms/op 5.7181 ms/op 1.03
UintBigint64 x 100000 serialize 2.6286 ms/op 2.6136 ms/op 1.01
UintBigint128 x 100000 deserialize 8.8702 ms/op 9.0189 ms/op 0.98
UintBigint128 x 100000 serialize 27.777 ms/op 27.714 ms/op 1.00
UintBigint256 x 100000 deserialize 16.735 ms/op 17.443 ms/op 0.96
UintBigint256 x 100000 serialize 83.497 ms/op 84.889 ms/op 0.98
Slice from Uint8Array x25000 1.6588 ms/op 1.8761 ms/op 0.88
Slice from ArrayBuffer x25000 28.694 ms/op 31.225 ms/op 0.92
Slice from ArrayBuffer x25000 + new Uint8Array 31.378 ms/op 33.530 ms/op 0.94
Copy Uint8Array 100000 iterate 1.7473 ms/op 1.7536 ms/op 1.00
Copy Uint8Array 100000 slice 274.07 us/op 310.82 us/op 0.88
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 295.98 us/op 301.14 us/op 0.98
Copy Buffer 100000 Uint8Array.prototype.slice.call 329.55 us/op 304.11 us/op 1.08
Copy Uint8Array 100000 slice + set 623.04 us/op 646.27 us/op 0.96
Copy Uint8Array 100000 subarray + set 298.18 us/op 337.73 us/op 0.88
Copy Uint8Array 100000 slice arrayBuffer 302.98 us/op 323.61 us/op 0.94
Uint64 deserialize 100000 - iterate Uint8Array 2.2351 ms/op 2.2727 ms/op 0.98
Uint64 deserialize 100000 - by Uint32A 2.0890 ms/op 2.1149 ms/op 0.99
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.1906 ms/op 2.2495 ms/op 0.97
Uint64 deserialize 100000 - by DataView.getBigUint64 7.1799 ms/op 7.1927 ms/op 1.00
Uint64 deserialize 100000 - by byte 69.276 ms/op 68.413 ms/op 1.01

by benchmarkbot/action

@wemeetagain
Copy link
Member

@g11tech I did a review of this PR and added some commits on top, let me know what you think.

@g11tech g11tech merged commit 3b714a2 into master Sep 9, 2023
@g11tech g11tech deleted the g11tech/optional-type branch September 9, 2023 11:45
@g11tech
Copy link
Contributor Author

g11tech commented Sep 9, 2023

have merged for now @wemeetagain , we can try adding other view/tree methods if there is need 👍

Also as per the plan, the executionWitness might get serialized later on for embedding in executionPayload so we might not need this at all (but i guess ethereumjs and/or other EL side codebases would be able to use this, so good for ecosystem in general)

@wemeetagain wemeetagain mentioned this pull request Sep 9, 2023
@nflaig nflaig mentioned this pull request Sep 29, 2023
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