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

fix: handle setBitOr in ListBasicTreeViewDU.sliceTo() #338

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 22, 2023

Motivation

The implementation in #336 does not work with element type as UintNumberType setBitWise true because we cannot set to 0 with tree_setToPackedNode api

Description

  • Instead of clone and set remaining index of same chunk to 0, we create LeafNode from 0 and copy value up to index

Steps to test or reproduce

Run unit tests

@github-actions github-actions bot added the ssz label Sep 22, 2023
@github-actions
Copy link

github-actions bot commented Sep 22, 2023

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: dd2b3e5 Previous: e84686b Ratio
Uint32Array.set len 300000 282.08 us/op 855.64 us/op 0.33
Container({a: uint8, b: uint8}) getViewDU x300000 27.713 ms/op 90.326 ms/op 0.31
Full benchmark results
Benchmark suite Current: dd2b3e5 Previous: e84686b Ratio
digestTwoHashObjects 50023 times 68.679 ms/op 69.640 ms/op 0.99
digest64 50023 times 70.626 ms/op 71.442 ms/op 0.99
digest 50023 times 70.214 ms/op 71.279 ms/op 0.99
input length 32 1.5650 us/op 1.6200 us/op 0.97
input length 64 1.7960 us/op 1.8480 us/op 0.97
input length 128 3.1230 us/op 3.1610 us/op 0.99
input length 256 4.7880 us/op 4.7760 us/op 1.00
input length 512 7.9630 us/op 8.0080 us/op 0.99
input length 1024 15.675 us/op 15.714 us/op 1.00
digest 1000000 times 1.1308 s/op 1.1396 s/op 0.99
hashObjectToByteArray 50023 times 1.9023 ms/op 1.9773 ms/op 0.96
byteArrayToHashObject 50023 times 2.0429 ms/op 2.5535 ms/op 0.80
getGindicesAtDepth 5.0820 us/op 5.6100 us/op 0.91
iterateAtDepth 10.947 us/op 11.813 us/op 0.93
getGindexBits 536.00 ns/op 591.00 ns/op 0.91
gindexIterator 1.2660 us/op 1.4300 us/op 0.89
hash 2 Uint8Array 2250026 times - as-sha256 3.2036 s/op 3.3163 s/op 0.97
hashTwoObjects 2250026 times - as-sha256 3.1201 s/op 3.1522 s/op 0.99
hash 2 Uint8Array 2250026 times - noble 8.5559 s/op 11.713 s/op 0.73
hashTwoObjects 2250026 times - noble 10.996 s/op 13.850 s/op 0.79
getNodeH() x7812.5 avg hindex 20.939 us/op 21.392 us/op 0.98
getNodeH() x7812.5 index 0 6.8160 us/op 7.2730 us/op 0.94
getNodeH() x7812.5 index 7 6.8550 us/op 7.3710 us/op 0.93
getNodeH() x7812.5 index 7 with key array 6.8750 us/op 7.2650 us/op 0.95
new LeafNode() x7812.5 529.08 us/op 340.86 us/op 1.55
multiproof - depth 15, 1 requested leaves 15.106 us/op 19.122 us/op 0.79
tree offset multiproof - depth 15, 1 requested leaves 28.698 us/op 44.235 us/op 0.65
compact multiproof - depth 15, 1 requested leaves 7.6980 us/op 12.387 us/op 0.62
multiproof - depth 15, 2 requested leaves 18.686 us/op 24.270 us/op 0.77
tree offset multiproof - depth 15, 2 requested leaves 33.703 us/op 44.701 us/op 0.75
compact multiproof - depth 15, 2 requested leaves 4.5400 us/op 4.9290 us/op 0.92
multiproof - depth 15, 3 requested leaves 25.526 us/op 32.789 us/op 0.78
tree offset multiproof - depth 15, 3 requested leaves 43.390 us/op 56.288 us/op 0.77
compact multiproof - depth 15, 3 requested leaves 7.7820 us/op 12.942 us/op 0.60
multiproof - depth 15, 4 requested leaves 33.599 us/op 42.076 us/op 0.80
tree offset multiproof - depth 15, 4 requested leaves 54.670 us/op 68.926 us/op 0.79
compact multiproof - depth 15, 4 requested leaves 8.6780 us/op 14.147 us/op 0.61
packedRootsBytesToLeafNodes bytes 4000 offset 0 2.7590 us/op 4.1540 us/op 0.66
packedRootsBytesToLeafNodes bytes 4000 offset 1 2.7450 us/op 4.3710 us/op 0.63
packedRootsBytesToLeafNodes bytes 4000 offset 2 2.7100 us/op 4.5130 us/op 0.60
packedRootsBytesToLeafNodes bytes 4000 offset 3 2.7380 us/op 4.2880 us/op 0.64
subtreeFillToContents depth 40 count 250000 70.411 ms/op 77.619 ms/op 0.91
setRoot - gindexBitstring 10.979 ms/op 17.320 ms/op 0.63
setRoot - gindex 12.301 ms/op 18.932 ms/op 0.65
getRoot - gindexBitstring 2.9323 ms/op 3.2683 ms/op 0.90
getRoot - gindex 4.2227 ms/op 4.4088 ms/op 0.96
getHashObject then setHashObject 14.844 ms/op 20.609 ms/op 0.72
setNodeWithFn 12.355 ms/op 19.001 ms/op 0.65
getNodeAtDepth depth 0 x100000 1.6139 ms/op 1.6208 ms/op 1.00
setNodeAtDepth depth 0 x100000 3.3722 ms/op 4.7174 ms/op 0.71
getNodesAtDepth depth 0 x100000 1.4191 ms/op 1.4180 ms/op 1.00
setNodesAtDepth depth 0 x100000 1.9779 ms/op 1.9757 ms/op 1.00
getNodeAtDepth depth 1 x100000 1.7394 ms/op 1.7420 ms/op 1.00
setNodeAtDepth depth 1 x100000 7.2221 ms/op 10.341 ms/op 0.70
getNodesAtDepth depth 1 x100000 1.5914 ms/op 1.5900 ms/op 1.00
setNodesAtDepth depth 1 x100000 5.9922 ms/op 7.8267 ms/op 0.77
getNodeAtDepth depth 2 x100000 2.1803 ms/op 2.2008 ms/op 0.99
setNodeAtDepth depth 2 x100000 12.097 ms/op 16.633 ms/op 0.73
getNodesAtDepth depth 2 x100000 25.683 ms/op 27.029 ms/op 0.95
setNodesAtDepth depth 2 x100000 20.243 ms/op 22.592 ms/op 0.90
tree.getNodesAtDepth - gindexes 6.4085 ms/op 9.2697 ms/op 0.69
tree.getNodesAtDepth - push all nodes 2.5121 ms/op 3.9816 ms/op 0.63
tree.getNodesAtDepth - navigation 201.44 us/op 201.60 us/op 1.00
tree.setNodesAtDepth - indexes 525.64 us/op 595.56 us/op 0.88
set at depth 8 713.00 ns/op 837.00 ns/op 0.85
set at depth 16 830.00 ns/op 1.2230 us/op 0.68
set at depth 32 1.3950 us/op 1.9870 us/op 0.70
iterateNodesAtDepth 8 256 17.624 us/op 19.431 us/op 0.91
getNodesAtDepth 8 256 4.3640 us/op 4.7080 us/op 0.93
iterateNodesAtDepth 16 65536 5.3559 ms/op 5.6873 ms/op 0.94
getNodesAtDepth 16 65536 2.2551 ms/op 3.3143 ms/op 0.68
iterateNodesAtDepth 32 250000 20.486 ms/op 21.282 ms/op 0.96
getNodesAtDepth 32 250000 5.7430 ms/op 7.6401 ms/op 0.75
iterateNodesAtDepth 40 250000 20.368 ms/op 21.180 ms/op 0.96
getNodesAtDepth 40 250000 5.7360 ms/op 7.6130 ms/op 0.75
250k validators 11.390 s/op 14.895 s/op 0.76
bitlist bytes to struct (120,90) 1.1030 us/op 1.2270 us/op 0.90
bitlist bytes to tree (120,90) 3.8690 us/op 4.5530 us/op 0.85
bitlist bytes to struct (2048,2048) 1.7870 us/op 2.4060 us/op 0.74
bitlist bytes to tree (2048,2048) 6.4850 us/op 9.1870 us/op 0.71
ByteListType - deserialize 14.244 ms/op 18.304 ms/op 0.78
BasicListType - deserialize 12.754 ms/op 24.643 ms/op 0.52
ByteListType - serialize 14.989 ms/op 17.970 ms/op 0.83
BasicListType - serialize 17.760 ms/op 23.425 ms/op 0.76
BasicListType - tree_convertToStruct 31.253 ms/op 46.087 ms/op 0.68
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.4208 ms/op 5.8787 ms/op 0.75
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.6269 ms/op 3.9596 ms/op 1.17
Array.push len 300000 empty Array - number 7.8626 ms/op 8.9562 ms/op 0.88
Array.set len 300000 from new Array - number 2.1572 ms/op 2.8931 ms/op 0.75
Array.set len 300000 - number 7.3738 ms/op 8.5705 ms/op 0.86
Uint8Array.set len 300000 234.70 us/op 244.99 us/op 0.96
Uint32Array.set len 300000 282.08 us/op 855.64 us/op 0.33
Container({a: uint8, b: uint8}) getViewDU x300000 27.713 ms/op 90.326 ms/op 0.31
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 12.307 ms/op 19.500 ms/op 0.63
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 474.82 ms/op 516.28 ms/op 0.92
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 404.00 ms/op 512.58 ms/op 0.79
List(Container) len 300000 ViewDU.get(i) 9.6173 ms/op 12.859 ms/op 0.75
List(Container) len 300000 ViewDU.getReadonly(i) 8.3714 ms/op 12.478 ms/op 0.67
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 48.865 ms/op 52.480 ms/op 0.93
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 6.7975 ms/op 9.2981 ms/op 0.73
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 8.4928 ms/op 11.831 ms/op 0.72
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 8.3594 ms/op 11.868 ms/op 0.70
Array.push len 300000 empty Array - object 7.2574 ms/op 9.0278 ms/op 0.80
Array.set len 300000 from new Array - object 2.7275 ms/op 4.4876 ms/op 0.61
Array.set len 300000 - object 6.6914 ms/op 8.6700 ms/op 0.77
cachePermanentRootStruct no cache 13.169 us/op 14.158 us/op 0.93
cachePermanentRootStruct with cache 284.00 ns/op 331.00 ns/op 0.86
epochParticipation len 250000 rws 7813 3.1306 ms/op 3.2972 ms/op 0.95
deserialize Attestation - tree 4.3080 us/op 5.0580 us/op 0.85
deserialize Attestation - struct 2.9640 us/op 3.3920 us/op 0.87
deserialize SignedAggregateAndProof - tree 5.5080 us/op 6.6690 us/op 0.83
deserialize SignedAggregateAndProof - struct 4.5920 us/op 5.2780 us/op 0.87
deserialize SyncCommitteeMessage - tree 1.6170 us/op 1.8650 us/op 0.87
deserialize SyncCommitteeMessage - struct 1.8150 us/op 2.2270 us/op 0.81
deserialize SignedContributionAndProof - tree 2.7700 us/op 3.2250 us/op 0.86
deserialize SignedContributionAndProof - struct 3.9360 us/op 4.8430 us/op 0.81
deserialize SignedBeaconBlock - tree 302.92 us/op 373.80 us/op 0.81
deserialize SignedBeaconBlock - struct 196.50 us/op 237.65 us/op 0.83
BeaconState vc 300000 - deserialize tree 807.97 ms/op 887.00 ms/op 0.91
BeaconState vc 300000 - serialize tree 267.81 ms/op 171.89 ms/op 1.56
BeaconState.historicalRoots vc 300000 - deserialize tree 1.1780 us/op 1.2700 us/op 0.93
BeaconState.historicalRoots vc 300000 - serialize tree 1.2600 us/op 1.4860 us/op 0.85
BeaconState.validators vc 300000 - deserialize tree 829.65 ms/op 909.78 ms/op 0.91
BeaconState.validators vc 300000 - serialize tree 198.59 ms/op 231.37 ms/op 0.86
BeaconState.balances vc 300000 - deserialize tree 32.737 ms/op 36.016 ms/op 0.91
BeaconState.balances vc 300000 - serialize tree 3.4728 ms/op 6.6848 ms/op 0.52
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 455.39 us/op 843.05 us/op 0.54
BeaconState.previousEpochParticipation vc 300000 - serialize tree 339.20 us/op 367.13 us/op 0.92
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 462.37 us/op 845.53 us/op 0.55
BeaconState.currentEpochParticipation vc 300000 - serialize tree 331.12 us/op 368.00 us/op 0.90
BeaconState.inactivityScores vc 300000 - deserialize tree 35.034 ms/op 39.482 ms/op 0.89
BeaconState.inactivityScores vc 300000 - serialize tree 3.7421 ms/op 6.2821 ms/op 0.60
hashTreeRoot Attestation - struct 41.467 us/op 62.534 us/op 0.66
hashTreeRoot Attestation - tree 29.196 us/op 36.662 us/op 0.80
hashTreeRoot SignedAggregateAndProof - struct 58.457 us/op 80.505 us/op 0.73
hashTreeRoot SignedAggregateAndProof - tree 40.588 us/op 42.173 us/op 0.96
hashTreeRoot SyncCommitteeMessage - struct 13.759 us/op 19.243 us/op 0.72
hashTreeRoot SyncCommitteeMessage - tree 9.0100 us/op 9.2080 us/op 0.98
hashTreeRoot SignedContributionAndProof - struct 38.960 us/op 52.834 us/op 0.74
hashTreeRoot SignedContributionAndProof - tree 28.454 us/op 32.714 us/op 0.87
hashTreeRoot SignedBeaconBlock - struct 3.3557 ms/op 4.0247 ms/op 0.83
hashTreeRoot SignedBeaconBlock - tree 2.4189 ms/op 2.4251 ms/op 1.00
hashTreeRoot Validator - struct 18.108 us/op 20.929 us/op 0.87
hashTreeRoot Validator - tree 15.360 us/op 16.553 us/op 0.93
BeaconState vc 300000 - hashTreeRoot tree 5.0789 s/op 5.2684 s/op 0.96
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 2.0180 us/op 2.1450 us/op 0.94
BeaconState.validators vc 300000 - hashTreeRoot tree 4.8482 s/op 5.0272 s/op 0.96
BeaconState.balances vc 300000 - hashTreeRoot tree 126.78 ms/op 128.95 ms/op 0.98
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 13.160 ms/op 13.223 ms/op 1.00
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 13.164 ms/op 13.217 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 130.03 ms/op 132.71 ms/op 0.98
hash64 x18 27.823 us/op 28.626 us/op 0.97
hashTwoObjects x18 25.851 us/op 27.366 us/op 0.94
hash64 x1740 2.6415 ms/op 2.7316 ms/op 0.97
hashTwoObjects x1740 2.4475 ms/op 2.5517 ms/op 0.96
hash64 x2700000 4.0814 s/op 4.2206 s/op 0.97
hashTwoObjects x2700000 3.7813 s/op 4.0114 s/op 0.94
get_exitEpoch - ContainerType 465.00 ns/op 499.00 ns/op 0.93
get_exitEpoch - ContainerNodeStructType 402.00 ns/op 431.00 ns/op 0.93
set_exitEpoch - ContainerType 447.00 ns/op 492.00 ns/op 0.91
set_exitEpoch - ContainerNodeStructType 418.00 ns/op 436.00 ns/op 0.96
get_pubkey - ContainerType 1.6990 us/op 2.1220 us/op 0.80
get_pubkey - ContainerNodeStructType 297.00 ns/op 332.00 ns/op 0.89
hashTreeRoot - ContainerType 495.00 ns/op 549.00 ns/op 0.90
hashTreeRoot - ContainerNodeStructType 560.00 ns/op 641.00 ns/op 0.87
createProof - ContainerType 6.6540 us/op 7.4480 us/op 0.89
createProof - ContainerNodeStructType 33.364 us/op 38.563 us/op 0.87
serialize - ContainerType 2.8820 us/op 3.3850 us/op 0.85
serialize - ContainerNodeStructType 2.3890 us/op 2.8770 us/op 0.83
set_exitEpoch_and_hashTreeRoot - ContainerType 5.9400 us/op 6.8070 us/op 0.87
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 16.663 us/op 18.551 us/op 0.90
Array - for of 11.388 us/op 11.363 us/op 1.00
Array - for(;;) 10.287 us/op 10.086 us/op 1.02
basicListValue.readonlyValuesArray() 4.2997 ms/op 5.7984 ms/op 0.74
basicListValue.readonlyValuesArray() + loop all 4.4041 ms/op 5.8478 ms/op 0.75
compositeListValue.readonlyValuesArray() 31.883 ms/op 35.673 ms/op 0.89
compositeListValue.readonlyValuesArray() + loop all 28.153 ms/op 34.679 ms/op 0.81
Number64UintType - get balances list 1.5280 ms/op 1.5278 ms/op 1.00
Number64UintType - set balances list 12.873 ms/op 14.280 ms/op 0.90
Number64UintType - get and increase 10 then set 44.521 ms/op 47.910 ms/op 0.93
Number64UintType - increase 10 using applyDelta 16.954 ms/op 17.831 ms/op 0.95
Number64UintType - increase 10 using applyDeltaInBatch 16.969 ms/op 17.980 ms/op 0.94
tree_newTreeFromUint64Deltas 21.970 ms/op 25.369 ms/op 0.87
unsafeUint8ArrayToTree 40.079 ms/op 43.844 ms/op 0.91
bitLength(50) 289.00 ns/op 307.00 ns/op 0.94
bitLengthStr(50) 314.00 ns/op 344.00 ns/op 0.91
bitLength(8000) 281.00 ns/op 296.00 ns/op 0.95
bitLengthStr(8000) 365.00 ns/op 405.00 ns/op 0.90
bitLength(250000) 280.00 ns/op 292.00 ns/op 0.96
bitLengthStr(250000) 419.00 ns/op 461.00 ns/op 0.91
floor - Math.floor (53) 0.60253 ns/op 0.60311 ns/op 1.00
floor - << 0 (53) 0.60253 ns/op 0.60311 ns/op 1.00
floor - Math.floor (512) 0.60261 ns/op 0.60313 ns/op 1.00
floor - << 0 (512) 0.60260 ns/op 0.60293 ns/op 1.00
fnIf(0) 2.0078 ns/op 2.0091 ns/op 1.00
fnSwitch(0) 3.3141 ns/op 3.3247 ns/op 1.00
fnObj(0) 0.60312 ns/op 0.60305 ns/op 1.00
fnArr(0) 0.60256 ns/op 0.60303 ns/op 1.00
fnIf(4) 3.1127 ns/op 3.1700 ns/op 0.98
fnSwitch(4) 3.3481 ns/op 3.3097 ns/op 1.01
fnObj(4) 0.60261 ns/op 0.60355 ns/op 1.00
fnArr(4) 0.60250 ns/op 0.60322 ns/op 1.00
fnIf(9) 5.2299 ns/op 5.2277 ns/op 1.00
fnSwitch(9) 3.3864 ns/op 3.3230 ns/op 1.02
fnObj(9) 0.60251 ns/op 0.60304 ns/op 1.00
fnArr(9) 0.60258 ns/op 0.60316 ns/op 1.00
Container {a,b,vec} - as struct x100000 60.518 us/op 60.557 us/op 1.00
Container {a,b,vec} - as tree x100000 511.40 us/op 501.76 us/op 1.02
Container {a,vec,b} - as struct x100000 120.74 us/op 120.85 us/op 1.00
Container {a,vec,b} - as tree x100000 554.83 us/op 549.33 us/op 1.01
get 2 props x1000000 - rawObject 401.88 us/op 402.17 us/op 1.00
get 2 props x1000000 - proxy 89.548 ms/op 93.786 ms/op 0.95
get 2 props x1000000 - customObj 401.79 us/op 402.13 us/op 1.00
Simple object binary -> struct 780.00 ns/op 812.00 ns/op 0.96
Simple object binary -> tree_backed 2.2410 us/op 2.5560 us/op 0.88
Simple object struct -> tree_backed 3.1530 us/op 3.3900 us/op 0.93
Simple object tree_backed -> struct 2.6690 us/op 2.8730 us/op 0.93
Simple object struct -> binary 1.4220 us/op 1.6810 us/op 0.85
Simple object tree_backed -> binary 2.4410 us/op 2.6940 us/op 0.91
aggregationBits binary -> struct 649.00 ns/op 764.00 ns/op 0.85
aggregationBits binary -> tree_backed 3.2410 us/op 3.7540 us/op 0.86
aggregationBits struct -> tree_backed 3.8540 us/op 4.7720 us/op 0.81
aggregationBits tree_backed -> struct 1.6540 us/op 2.0000 us/op 0.83
aggregationBits struct -> binary 1.1170 us/op 1.4700 us/op 0.76
aggregationBits tree_backed -> binary 1.5000 us/op 1.7870 us/op 0.84
List(uint8) 100000 binary -> struct 1.8564 ms/op 2.3199 ms/op 0.80
List(uint8) 100000 binary -> tree_backed 136.78 us/op 199.17 us/op 0.69
List(uint8) 100000 struct -> tree_backed 1.6768 ms/op 1.8762 ms/op 0.89
List(uint8) 100000 tree_backed -> struct 1.1963 ms/op 1.2985 ms/op 0.92
List(uint8) 100000 struct -> binary 1.5270 ms/op 1.6699 ms/op 0.91
List(uint8) 100000 tree_backed -> binary 95.861 us/op 95.004 us/op 1.01
List(uint64Number) 100000 binary -> struct 1.4735 ms/op 1.5554 ms/op 0.95
List(uint64Number) 100000 binary -> tree_backed 4.3351 ms/op 4.9065 ms/op 0.88
List(uint64Number) 100000 struct -> tree_backed 6.2113 ms/op 6.7767 ms/op 0.92
List(uint64Number) 100000 tree_backed -> struct 2.6246 ms/op 2.9888 ms/op 0.88
List(uint64Number) 100000 struct -> binary 1.8665 ms/op 1.9983 ms/op 0.93
List(uint64Number) 100000 tree_backed -> binary 1.2030 ms/op 1.5214 ms/op 0.79
List(Uint64Bigint) 100000 binary -> struct 4.7658 ms/op 4.7295 ms/op 1.01
List(Uint64Bigint) 100000 binary -> tree_backed 4.3535 ms/op 5.8863 ms/op 0.74
List(Uint64Bigint) 100000 struct -> tree_backed 7.5757 ms/op 8.5808 ms/op 0.88
List(Uint64Bigint) 100000 tree_backed -> struct 5.4646 ms/op 6.0092 ms/op 0.91
List(Uint64Bigint) 100000 struct -> binary 2.6016 ms/op 2.6454 ms/op 0.98
List(Uint64Bigint) 100000 tree_backed -> binary 1.1277 ms/op 1.5102 ms/op 0.75
Vector(Root) 100000 binary -> struct 46.543 ms/op 45.877 ms/op 1.01
Vector(Root) 100000 binary -> tree_backed 45.219 ms/op 46.044 ms/op 0.98
Vector(Root) 100000 struct -> tree_backed 56.411 ms/op 60.586 ms/op 0.93
Vector(Root) 100000 tree_backed -> struct 64.292 ms/op 67.568 ms/op 0.95
Vector(Root) 100000 struct -> binary 2.4392 ms/op 2.6919 ms/op 0.91
Vector(Root) 100000 tree_backed -> binary 10.933 ms/op 12.121 ms/op 0.90
List(Validator) 100000 binary -> struct 159.49 ms/op 182.60 ms/op 0.87
List(Validator) 100000 binary -> tree_backed 422.20 ms/op 481.34 ms/op 0.88
List(Validator) 100000 struct -> tree_backed 469.49 ms/op 518.40 ms/op 0.91
List(Validator) 100000 tree_backed -> struct 269.58 ms/op 282.74 ms/op 0.95
List(Validator) 100000 struct -> binary 39.803 ms/op 41.056 ms/op 0.97
List(Validator) 100000 tree_backed -> binary 111.67 ms/op 116.43 ms/op 0.96
List(Validator-NS) 100000 binary -> struct 171.17 ms/op 170.53 ms/op 1.00
List(Validator-NS) 100000 binary -> tree_backed 235.20 ms/op 249.82 ms/op 0.94
List(Validator-NS) 100000 struct -> tree_backed 286.25 ms/op 305.25 ms/op 0.94
List(Validator-NS) 100000 tree_backed -> struct 238.53 ms/op 251.05 ms/op 0.95
List(Validator-NS) 100000 struct -> binary 40.800 ms/op 40.810 ms/op 1.00
List(Validator-NS) 100000 tree_backed -> binary 48.058 ms/op 48.117 ms/op 1.00
get epochStatuses - MutableVector 100.25 us/op 102.50 us/op 0.98
get epochStatuses - ViewDU 237.97 us/op 249.10 us/op 0.96
set epochStatuses - ListTreeView 1.9122 ms/op 1.9878 ms/op 0.96
set epochStatuses - ListTreeView - set() 603.95 us/op 607.96 us/op 0.99
set epochStatuses - ListTreeView - commit() 552.82 us/op 606.13 us/op 0.91
bitstring 922.30 ns/op 924.80 ns/op 1.00
bit mask 14.489 ns/op 14.505 ns/op 1.00
struct - increase slot to 1000000 1.9779 ms/op 1.7149 ms/op 1.15
UintNumberType - increase slot to 1000000 37.508 ms/op 36.459 ms/op 1.03
UintBigintType - increase slot to 1000000 551.47 ms/op 573.75 ms/op 0.96
UintBigint8 x 100000 tree_deserialize 6.5765 ms/op 5.6404 ms/op 1.17
UintBigint8 x 100000 tree_serialize 1.4572 ms/op 741.42 us/op 1.97
UintBigint16 x 100000 tree_deserialize 6.3994 ms/op 5.4073 ms/op 1.18
UintBigint16 x 100000 tree_serialize 1.5137 ms/op 1.7411 ms/op 0.87
UintBigint32 x 100000 tree_deserialize 6.7085 ms/op 7.1271 ms/op 0.94
UintBigint32 x 100000 tree_serialize 1.5232 ms/op 2.3093 ms/op 0.66
UintBigint64 x 100000 tree_deserialize 7.4022 ms/op 7.8230 ms/op 0.95
UintBigint64 x 100000 tree_serialize 2.0400 ms/op 2.2974 ms/op 0.89
UintBigint8 x 100000 value_deserialize 635.04 us/op 538.58 us/op 1.18
UintBigint8 x 100000 value_serialize 968.34 us/op 1.1142 ms/op 0.87
UintBigint16 x 100000 value_deserialize 596.37 us/op 584.66 us/op 1.02
UintBigint16 x 100000 value_serialize 942.16 us/op 1.1745 ms/op 0.80
UintBigint32 x 100000 value_deserialize 542.12 us/op 544.10 us/op 1.00
UintBigint32 x 100000 value_serialize 947.11 us/op 1.1859 ms/op 0.80
UintBigint64 x 100000 value_deserialize 608.03 us/op 610.01 us/op 1.00
UintBigint64 x 100000 value_serialize 1.1630 ms/op 1.4237 ms/op 0.82
UintBigint8 x 100000 deserialize 6.1436 ms/op 6.3625 ms/op 0.97
UintBigint8 x 100000 serialize 1.9583 ms/op 2.0128 ms/op 0.97
UintBigint16 x 100000 deserialize 5.9405 ms/op 5.7809 ms/op 1.03
UintBigint16 x 100000 serialize 1.9471 ms/op 2.0700 ms/op 0.94
UintBigint32 x 100000 deserialize 6.9929 ms/op 7.3565 ms/op 0.95
UintBigint32 x 100000 serialize 3.6029 ms/op 3.7060 ms/op 0.97
UintBigint64 x 100000 deserialize 4.8851 ms/op 5.0727 ms/op 0.96
UintBigint64 x 100000 serialize 1.9205 ms/op 1.9048 ms/op 1.01
UintBigint128 x 100000 deserialize 7.0696 ms/op 7.4742 ms/op 0.95
UintBigint128 x 100000 serialize 21.533 ms/op 22.855 ms/op 0.94
UintBigint256 x 100000 deserialize 13.154 ms/op 14.489 ms/op 0.91
UintBigint256 x 100000 serialize 67.334 ms/op 66.575 ms/op 1.01
Slice from Uint8Array x25000 1.2547 ms/op 1.5749 ms/op 0.80
Slice from ArrayBuffer x25000 25.824 ms/op 28.754 ms/op 0.90
Slice from ArrayBuffer x25000 + new Uint8Array 25.385 ms/op 32.209 ms/op 0.79
Copy Uint8Array 100000 iterate 1.0231 ms/op 1.0772 ms/op 0.95
Copy Uint8Array 100000 slice 84.295 us/op 133.88 us/op 0.63
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 85.096 us/op 133.25 us/op 0.64
Copy Buffer 100000 Uint8Array.prototype.slice.call 84.986 us/op 132.24 us/op 0.64
Copy Uint8Array 100000 slice + set 181.90 us/op 280.22 us/op 0.65
Copy Uint8Array 100000 subarray + set 85.918 us/op 132.77 us/op 0.65
Copy Uint8Array 100000 slice arrayBuffer 85.347 us/op 135.50 us/op 0.63
Uint64 deserialize 100000 - iterate Uint8Array 2.0929 ms/op 2.2426 ms/op 0.93
Uint64 deserialize 100000 - by Uint32A 1.8640 ms/op 2.1752 ms/op 0.86
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.8767 ms/op 2.1691 ms/op 0.87
Uint64 deserialize 100000 - by DataView.getBigUint64 5.6787 ms/op 6.0728 ms/op 0.94
Uint64 deserialize 100000 - by byte 72.496 ms/op 72.904 ms/op 0.99

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review September 24, 2023 07:34
@twoeths twoeths requested a review from a team as a code owner September 24, 2023 07:34
@twoeths twoeths merged commit 5c5242a into master Oct 4, 2023
8 checks passed
@twoeths twoeths deleted the tuyen/list_basic_slice_to_setBitwiseOR branch October 4, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants