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 capability to cache merkle roots for lists #349

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Mar 1, 2024

need to cache merkle root of big lists (Transactions), as well as to allow setting the cached root (so needing cached symbol import) so that if we have for e.g. transactionsRoot, that can be set on transactions helping avoid merklelization of it in big blocks

@g11tech g11tech requested a review from a team as a code owner March 1, 2024 13:37
@github-actions github-actions bot added the ssz label Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f3aadf4 Previous: 6220d32 Ratio
digestTwoHashObjects 50023 times 47.723 ms/op 47.451 ms/op 1.01
digest64 50023 times 49.340 ms/op 48.513 ms/op 1.02
digest 50023 times 49.155 ms/op 49.148 ms/op 1.00
input length 32 1.2270 us/op 1.1400 us/op 1.08
input length 64 1.2770 us/op 1.2700 us/op 1.01
input length 128 2.2580 us/op 2.2140 us/op 1.02
input length 256 3.3020 us/op 3.3030 us/op 1.00
input length 512 5.5700 us/op 5.4920 us/op 1.01
input length 1024 10.810 us/op 10.835 us/op 1.00
digest 1000000 times 821.44 ms/op 777.08 ms/op 1.06
hashObjectToByteArray 50023 times 1.4301 ms/op 1.4645 ms/op 0.98
byteArrayToHashObject 50023 times 1.7294 ms/op 1.6627 ms/op 1.04
getGindicesAtDepth 4.0010 us/op 3.9520 us/op 1.01
iterateAtDepth 9.1300 us/op 8.4810 us/op 1.08
getGindexBits 425.00 ns/op 423.00 ns/op 1.00
gindexIterator 998.00 ns/op 952.00 ns/op 1.05
hash 2 Uint8Array 2250026 times - as-sha256 2.2527 s/op 2.2238 s/op 1.01
hashTwoObjects 2250026 times - as-sha256 2.1572 s/op 2.1564 s/op 1.00
hash 2 Uint8Array 2250026 times - noble 5.2306 s/op 4.6188 s/op 1.13
hashTwoObjects 2250026 times - noble 8.0484 s/op 6.7975 s/op 1.18
getNodeH() x7812.5 avg hindex 14.795 us/op 14.548 us/op 1.02
getNodeH() x7812.5 index 0 5.2390 us/op 5.1490 us/op 1.02
getNodeH() x7812.5 index 7 5.1700 us/op 5.1510 us/op 1.00
getNodeH() x7812.5 index 7 with key array 5.1490 us/op 5.0550 us/op 1.02
new LeafNode() x7812.5 113.86 us/op 113.37 us/op 1.00
multiproof - depth 15, 1 requested leaves 9.8400 us/op 9.4680 us/op 1.04
tree offset multiproof - depth 15, 1 requested leaves 21.724 us/op 20.621 us/op 1.05
compact multiproof - depth 15, 1 requested leaves 5.9050 us/op 5.5070 us/op 1.07
multiproof - depth 15, 2 requested leaves 14.131 us/op 12.922 us/op 1.09
tree offset multiproof - depth 15, 2 requested leaves 25.441 us/op 23.147 us/op 1.10
compact multiproof - depth 15, 2 requested leaves 3.2420 us/op 3.3580 us/op 0.97
multiproof - depth 15, 3 requested leaves 19.471 us/op 17.866 us/op 1.09
tree offset multiproof - depth 15, 3 requested leaves 33.987 us/op 30.400 us/op 1.12
compact multiproof - depth 15, 3 requested leaves 5.7440 us/op 4.6320 us/op 1.24
multiproof - depth 15, 4 requested leaves 26.793 us/op 23.828 us/op 1.12
tree offset multiproof - depth 15, 4 requested leaves 41.421 us/op 38.089 us/op 1.09
compact multiproof - depth 15, 4 requested leaves 6.4570 us/op 5.2770 us/op 1.22
packedRootsBytesToLeafNodes bytes 4000 offset 0 2.0860 us/op 1.9990 us/op 1.04
packedRootsBytesToLeafNodes bytes 4000 offset 1 2.0660 us/op 2.0010 us/op 1.03
packedRootsBytesToLeafNodes bytes 4000 offset 2 1.9040 us/op 2.0090 us/op 0.95
packedRootsBytesToLeafNodes bytes 4000 offset 3 1.7330 us/op 1.9920 us/op 0.87
subtreeFillToContents depth 40 count 250000 41.230 ms/op 43.686 ms/op 0.94
setRoot - gindexBitstring 9.5003 ms/op 8.7390 ms/op 1.09
setRoot - gindex 10.552 ms/op 9.4315 ms/op 1.12
getRoot - gindexBitstring 2.8239 ms/op 2.4095 ms/op 1.17
getRoot - gindex 3.6426 ms/op 3.2480 ms/op 1.12
getHashObject then setHashObject 12.073 ms/op 10.367 ms/op 1.16
setNodeWithFn 11.024 ms/op 9.1894 ms/op 1.20
getNodeAtDepth depth 0 x100000 1.1442 ms/op 1.1471 ms/op 1.00
setNodeAtDepth depth 0 x100000 3.3134 ms/op 2.7974 ms/op 1.18
getNodesAtDepth depth 0 x100000 1.0831 ms/op 1.0834 ms/op 1.00
setNodesAtDepth depth 0 x100000 1.4847 ms/op 1.4935 ms/op 0.99
getNodeAtDepth depth 1 x100000 1.2316 ms/op 1.2074 ms/op 1.02
setNodeAtDepth depth 1 x100000 6.8870 ms/op 5.7980 ms/op 1.19
getNodesAtDepth depth 1 x100000 1.2103 ms/op 1.2088 ms/op 1.00
setNodesAtDepth depth 1 x100000 5.5739 ms/op 4.6802 ms/op 1.19
getNodeAtDepth depth 2 x100000 1.5152 ms/op 1.4852 ms/op 1.02
setNodeAtDepth depth 2 x100000 11.493 ms/op 10.474 ms/op 1.10
getNodesAtDepth depth 2 x100000 21.869 ms/op 20.510 ms/op 1.07
setNodesAtDepth depth 2 x100000 16.042 ms/op 13.700 ms/op 1.17
tree.getNodesAtDepth - gindexes 8.9591 ms/op 6.0009 ms/op 1.49
tree.getNodesAtDepth - push all nodes 2.8777 ms/op 2.2066 ms/op 1.30
tree.getNodesAtDepth - navigation 164.23 us/op 157.91 us/op 1.04
tree.setNodesAtDepth - indexes 495.90 us/op 374.22 us/op 1.33
set at depth 8 738.00 ns/op 514.00 ns/op 1.44
set at depth 16 1.0100 us/op 664.00 ns/op 1.52
set at depth 32 1.4960 us/op 1.0370 us/op 1.44
iterateNodesAtDepth 8 256 18.297 us/op 13.906 us/op 1.32
getNodesAtDepth 8 256 3.9680 us/op 3.3930 us/op 1.17
iterateNodesAtDepth 16 65536 5.2023 ms/op 4.2306 ms/op 1.23
getNodesAtDepth 16 65536 2.3463 ms/op 2.0146 ms/op 1.16
iterateNodesAtDepth 32 250000 18.832 ms/op 16.975 ms/op 1.11
getNodesAtDepth 32 250000 6.4531 ms/op 4.2259 ms/op 1.53
iterateNodesAtDepth 40 250000 18.742 ms/op 14.758 ms/op 1.27
getNodesAtDepth 40 250000 6.5415 ms/op 4.2287 ms/op 1.55
250k validators 10.034 s/op 7.0207 s/op 1.43
bitlist bytes to struct (120,90) 800.00 ns/op 576.00 ns/op 1.39
bitlist bytes to tree (120,90) 2.5180 us/op 2.2300 us/op 1.13
bitlist bytes to struct (2048,2048) 1.0720 us/op 998.00 ns/op 1.07
bitlist bytes to tree (2048,2048) 3.8090 us/op 3.4800 us/op 1.09
ByteListType - deserialize 7.8957 ms/op 8.1587 ms/op 0.97
BasicListType - deserialize 9.5491 ms/op 7.8204 ms/op 1.22
ByteListType - serialize 8.6968 ms/op 7.4434 ms/op 1.17
BasicListType - serialize 10.886 ms/op 9.9380 ms/op 1.10
BasicListType - tree_convertToStruct 24.170 ms/op 21.339 ms/op 1.13
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.1975 ms/op 4.2130 ms/op 1.00
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.1411 ms/op 4.3100 ms/op 0.96
Array.push len 300000 empty Array - number 6.3971 ms/op 6.2098 ms/op 1.03
Array.set len 300000 from new Array - number 1.6142 ms/op 1.6359 ms/op 0.99
Array.set len 300000 - number 5.7893 ms/op 5.0942 ms/op 1.14
Uint8Array.set len 300000 216.12 us/op 208.02 us/op 1.04
Uint32Array.set len 300000 300.90 us/op 291.01 us/op 1.03
Container({a: uint8, b: uint8}) getViewDU x300000 19.936 ms/op 19.737 ms/op 1.01
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 9.7474 ms/op 9.3814 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 218.01 ms/op 246.18 ms/op 0.89
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 312.20 ms/op 293.67 ms/op 1.06
List(Container) len 300000 ViewDU.get(i) 6.5362 ms/op 6.6744 ms/op 0.98
List(Container) len 300000 ViewDU.getReadonly(i) 6.5117 ms/op 6.5862 ms/op 0.99
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 38.652 ms/op 38.008 ms/op 1.02
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.6642 ms/op 5.1821 ms/op 1.09
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.3337 ms/op 6.1416 ms/op 1.03
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.0942 ms/op 5.9534 ms/op 1.02
Array.push len 300000 empty Array - object 6.6443 ms/op 5.8513 ms/op 1.14
Array.set len 300000 from new Array - object 1.9772 ms/op 1.9138 ms/op 1.03
Array.set len 300000 - object 6.2284 ms/op 5.7212 ms/op 1.09
cachePermanentRootStruct no cache 9.3290 us/op 8.9470 us/op 1.04
cachePermanentRootStruct with cache 255.00 ns/op 217.00 ns/op 1.18
epochParticipation len 250000 rws 7813 2.2563 ms/op 2.3121 ms/op 0.98
deserialize Attestation - tree 3.3280 us/op 2.8750 us/op 1.16
deserialize Attestation - struct 2.3610 us/op 1.9240 us/op 1.23
deserialize SignedAggregateAndProof - tree 4.1920 us/op 3.6870 us/op 1.14
deserialize SignedAggregateAndProof - struct 3.2290 us/op 2.9650 us/op 1.09
deserialize SyncCommitteeMessage - tree 1.1540 us/op 1.1820 us/op 0.98
deserialize SyncCommitteeMessage - struct 1.2440 us/op 1.2800 us/op 0.97
deserialize SignedContributionAndProof - tree 1.9250 us/op 1.9150 us/op 1.01
deserialize SignedContributionAndProof - struct 2.5060 us/op 2.4950 us/op 1.00
deserialize SignedBeaconBlock - tree 220.04 us/op 218.40 us/op 1.01
deserialize SignedBeaconBlock - struct 126.23 us/op 125.55 us/op 1.01
BeaconState vc 300000 - deserialize tree 618.40 ms/op 647.97 ms/op 0.95
BeaconState vc 300000 - serialize tree 153.89 ms/op 142.22 ms/op 1.08
BeaconState.historicalRoots vc 300000 - deserialize tree 864.00 ns/op 826.00 ns/op 1.05
BeaconState.historicalRoots vc 300000 - serialize tree 842.00 ns/op 800.00 ns/op 1.05
BeaconState.validators vc 300000 - deserialize tree 560.07 ms/op 646.73 ms/op 0.87
BeaconState.validators vc 300000 - serialize tree 124.87 ms/op 133.13 ms/op 0.94
BeaconState.balances vc 300000 - deserialize tree 20.853 ms/op 23.300 ms/op 0.89
BeaconState.balances vc 300000 - serialize tree 3.7641 ms/op 3.2543 ms/op 1.16
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 442.80 us/op 398.81 us/op 1.11
BeaconState.previousEpochParticipation vc 300000 - serialize tree 276.18 us/op 265.41 us/op 1.04
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 518.34 us/op 403.44 us/op 1.28
BeaconState.currentEpochParticipation vc 300000 - serialize tree 274.79 us/op 267.45 us/op 1.03
BeaconState.inactivityScores vc 300000 - deserialize tree 21.828 ms/op 26.134 ms/op 0.84
BeaconState.inactivityScores vc 300000 - serialize tree 2.9729 ms/op 2.7084 ms/op 1.10
hashTreeRoot Attestation - struct 27.522 us/op 28.230 us/op 0.97
hashTreeRoot Attestation - tree 18.067 us/op 18.223 us/op 0.99
hashTreeRoot SignedAggregateAndProof - struct 39.612 us/op 38.544 us/op 1.03
hashTreeRoot SignedAggregateAndProof - tree 28.153 us/op 27.823 us/op 1.01
hashTreeRoot SyncCommitteeMessage - struct 9.3860 us/op 9.1740 us/op 1.02
hashTreeRoot SyncCommitteeMessage - tree 6.2440 us/op 6.2360 us/op 1.00
hashTreeRoot SignedContributionAndProof - struct 26.169 us/op 26.322 us/op 0.99
hashTreeRoot SignedContributionAndProof - tree 19.508 us/op 19.913 us/op 0.98
hashTreeRoot SignedBeaconBlock - struct 2.2733 ms/op 2.4007 ms/op 0.95
hashTreeRoot SignedBeaconBlock - tree 1.6645 ms/op 1.6938 ms/op 0.98
hashTreeRoot Validator - struct 12.192 us/op 13.052 us/op 0.93
hashTreeRoot Validator - tree 11.049 us/op 11.057 us/op 1.00
BeaconState vc 300000 - hashTreeRoot tree 3.6616 s/op 3.6480 s/op 1.00
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.5030 us/op 1.5200 us/op 0.99
BeaconState.validators vc 300000 - hashTreeRoot tree 3.6020 s/op 3.5204 s/op 1.02
BeaconState.balances vc 300000 - hashTreeRoot tree 87.739 ms/op 90.631 ms/op 0.97
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 9.0319 ms/op 9.3016 ms/op 0.97
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 9.0401 ms/op 9.0244 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 82.710 ms/op 86.049 ms/op 0.96
hash64 x18 19.456 us/op 19.179 us/op 1.01
hashTwoObjects x18 17.818 us/op 17.936 us/op 0.99
hash64 x1740 1.8276 ms/op 1.8306 ms/op 1.00
hashTwoObjects x1740 1.6904 ms/op 1.7038 ms/op 0.99
hash64 x2700000 2.8598 s/op 2.8221 s/op 1.01
hashTwoObjects x2700000 2.6315 s/op 2.6427 s/op 1.00
get_exitEpoch - ContainerType 226.00 ns/op 212.00 ns/op 1.07
get_exitEpoch - ContainerNodeStructType 244.00 ns/op 207.00 ns/op 1.18
set_exitEpoch - ContainerType 265.00 ns/op 250.00 ns/op 1.06
set_exitEpoch - ContainerNodeStructType 229.00 ns/op 206.00 ns/op 1.11
get_pubkey - ContainerType 1.1660 us/op 959.00 ns/op 1.22
get_pubkey - ContainerNodeStructType 238.00 ns/op 212.00 ns/op 1.12
hashTreeRoot - ContainerType 433.00 ns/op 355.00 ns/op 1.22
hashTreeRoot - ContainerNodeStructType 476.00 ns/op 402.00 ns/op 1.18
createProof - ContainerType 4.6570 us/op 3.8640 us/op 1.21
createProof - ContainerNodeStructType 24.256 us/op 20.811 us/op 1.17
serialize - ContainerType 2.1760 us/op 1.9330 us/op 1.13
serialize - ContainerNodeStructType 1.8520 us/op 1.4700 us/op 1.26
set_exitEpoch_and_hashTreeRoot - ContainerType 4.3490 us/op 4.2160 us/op 1.03
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 11.811 us/op 11.253 us/op 1.05
Array - for of 5.1540 us/op 5.0570 us/op 1.02
Array - for(;;) 4.3670 us/op 4.3590 us/op 1.00
basicListValue.readonlyValuesArray() 4.6449 ms/op 3.6135 ms/op 1.29
basicListValue.readonlyValuesArray() + loop all 4.6628 ms/op 3.6827 ms/op 1.27
compositeListValue.readonlyValuesArray() 26.800 ms/op 27.018 ms/op 0.99
compositeListValue.readonlyValuesArray() + loop all 26.094 ms/op 24.661 ms/op 1.06
Number64UintType - get balances list 4.8600 ms/op 4.2458 ms/op 1.14
Number64UintType - set balances list 8.8521 ms/op 10.992 ms/op 0.81
Number64UintType - get and increase 10 then set 41.773 ms/op 36.256 ms/op 1.15
Number64UintType - increase 10 using applyDelta 16.602 ms/op 15.966 ms/op 1.04
Number64UintType - increase 10 using applyDeltaInBatch 16.476 ms/op 16.781 ms/op 0.98
tree_newTreeFromUint64Deltas 17.194 ms/op 17.078 ms/op 1.01
unsafeUint8ArrayToTree 31.431 ms/op 32.144 ms/op 0.98
bitLength(50) 252.00 ns/op 225.00 ns/op 1.12
bitLengthStr(50) 298.00 ns/op 238.00 ns/op 1.25
bitLength(8000) 248.00 ns/op 229.00 ns/op 1.08
bitLengthStr(8000) 336.00 ns/op 284.00 ns/op 1.18
bitLength(250000) 246.00 ns/op 219.00 ns/op 1.12
bitLengthStr(250000) 358.00 ns/op 311.00 ns/op 1.15
floor - Math.floor (53) 0.46881 ns/op 0.46415 ns/op 1.01
floor - << 0 (53) 0.46536 ns/op 0.46692 ns/op 1.00
floor - Math.floor (512) 0.46901 ns/op 0.46665 ns/op 1.01
floor - << 0 (512) 0.46401 ns/op 0.47120 ns/op 0.98
fnIf(0) 1.5457 ns/op 1.5463 ns/op 1.00
fnSwitch(0) 2.4746 ns/op 2.5137 ns/op 0.98
fnObj(0) 0.46831 ns/op 0.46444 ns/op 1.01
fnArr(0) 0.46455 ns/op 0.46435 ns/op 1.00
fnIf(4) 2.1762 ns/op 2.1653 ns/op 1.01
fnSwitch(4) 2.4759 ns/op 2.4724 ns/op 1.00
fnObj(4) 0.46474 ns/op 0.46471 ns/op 1.00
fnArr(4) 0.47192 ns/op 0.46520 ns/op 1.01
fnIf(9) 3.1004 ns/op 3.0949 ns/op 1.00
fnSwitch(9) 2.4743 ns/op 2.4881 ns/op 0.99
fnObj(9) 0.47140 ns/op 0.46454 ns/op 1.01
fnArr(9) 0.46382 ns/op 0.46414 ns/op 1.00
Container {a,b,vec} - as struct x100000 46.566 us/op 47.184 us/op 0.99
Container {a,b,vec} - as tree x100000 379.21 us/op 371.42 us/op 1.02
Container {a,vec,b} - as struct x100000 77.805 us/op 77.488 us/op 1.00
Container {a,vec,b} - as tree x100000 419.88 us/op 402.42 us/op 1.04
get 2 props x1000000 - rawObject 326.24 us/op 310.21 us/op 1.05
get 2 props x1000000 - proxy 71.188 ms/op 74.359 ms/op 0.96
get 2 props x1000000 - customObj 323.64 us/op 309.78 us/op 1.04
Simple object binary -> struct 881.00 ns/op 613.00 ns/op 1.44
Simple object binary -> tree_backed 2.4290 us/op 1.6940 us/op 1.43
Simple object struct -> tree_backed 3.1310 us/op 2.1200 us/op 1.48
Simple object tree_backed -> struct 2.5450 us/op 1.8700 us/op 1.36
Simple object struct -> binary 1.2590 us/op 913.00 ns/op 1.38
Simple object tree_backed -> binary 1.8590 us/op 1.6560 us/op 1.12
aggregationBits binary -> struct 705.00 ns/op 550.00 ns/op 1.28
aggregationBits binary -> tree_backed 2.6240 us/op 2.0700 us/op 1.27
aggregationBits struct -> tree_backed 3.0820 us/op 2.5230 us/op 1.22
aggregationBits tree_backed -> struct 1.3190 us/op 1.0490 us/op 1.26
aggregationBits struct -> binary 906.00 ns/op 754.00 ns/op 1.20
aggregationBits tree_backed -> binary 1.1510 us/op 973.00 ns/op 1.18
List(uint8) 100000 binary -> struct 1.3862 ms/op 1.2988 ms/op 1.07
List(uint8) 100000 binary -> tree_backed 89.038 us/op 86.831 us/op 1.03
List(uint8) 100000 struct -> tree_backed 1.3384 ms/op 1.3055 ms/op 1.03
List(uint8) 100000 tree_backed -> struct 985.42 us/op 953.73 us/op 1.03
List(uint8) 100000 struct -> binary 1.2704 ms/op 1.2184 ms/op 1.04
List(uint8) 100000 tree_backed -> binary 81.151 us/op 80.666 us/op 1.01
List(uint64Number) 100000 binary -> struct 1.2464 ms/op 1.2325 ms/op 1.01
List(uint64Number) 100000 binary -> tree_backed 3.0760 ms/op 3.7674 ms/op 0.82
List(uint64Number) 100000 struct -> tree_backed 4.6395 ms/op 5.0615 ms/op 0.92
List(uint64Number) 100000 tree_backed -> struct 2.0661 ms/op 2.1579 ms/op 0.96
List(uint64Number) 100000 struct -> binary 1.4425 ms/op 1.3691 ms/op 1.05
List(uint64Number) 100000 tree_backed -> binary 773.71 us/op 764.34 us/op 1.01
List(Uint64Bigint) 100000 binary -> struct 3.4987 ms/op 3.2282 ms/op 1.08
List(Uint64Bigint) 100000 binary -> tree_backed 3.1793 ms/op 3.8412 ms/op 0.83
List(Uint64Bigint) 100000 struct -> tree_backed 4.5863 ms/op 6.0559 ms/op 0.76
List(Uint64Bigint) 100000 tree_backed -> struct 4.1187 ms/op 4.0536 ms/op 1.02
List(Uint64Bigint) 100000 struct -> binary 2.0893 ms/op 2.0217 ms/op 1.03
List(Uint64Bigint) 100000 tree_backed -> binary 883.33 us/op 738.20 us/op 1.20
Vector(Root) 100000 binary -> struct 28.920 ms/op 33.636 ms/op 0.86
Vector(Root) 100000 binary -> tree_backed 29.368 ms/op 31.353 ms/op 0.94
Vector(Root) 100000 struct -> tree_backed 35.429 ms/op 41.874 ms/op 0.85
Vector(Root) 100000 tree_backed -> struct 43.232 ms/op 49.350 ms/op 0.88
Vector(Root) 100000 struct -> binary 1.8829 ms/op 1.9152 ms/op 0.98
Vector(Root) 100000 tree_backed -> binary 8.6404 ms/op 9.5106 ms/op 0.91
List(Validator) 100000 binary -> struct 96.827 ms/op 135.38 ms/op 0.72
List(Validator) 100000 binary -> tree_backed 266.94 ms/op 348.85 ms/op 0.77
List(Validator) 100000 struct -> tree_backed 304.94 ms/op 359.65 ms/op 0.85
List(Validator) 100000 tree_backed -> struct 194.63 ms/op 219.65 ms/op 0.89
List(Validator) 100000 struct -> binary 30.598 ms/op 30.378 ms/op 1.01
List(Validator) 100000 tree_backed -> binary 97.382 ms/op 104.90 ms/op 0.93
List(Validator-NS) 100000 binary -> struct 100.22 ms/op 119.72 ms/op 0.84
List(Validator-NS) 100000 binary -> tree_backed 153.14 ms/op 180.69 ms/op 0.85
List(Validator-NS) 100000 struct -> tree_backed 187.92 ms/op 211.23 ms/op 0.89
List(Validator-NS) 100000 tree_backed -> struct 151.53 ms/op 174.34 ms/op 0.87
List(Validator-NS) 100000 struct -> binary 31.343 ms/op 30.620 ms/op 1.02
List(Validator-NS) 100000 tree_backed -> binary 34.621 ms/op 35.677 ms/op 0.97
get epochStatuses - MutableVector 91.272 us/op 90.831 us/op 1.00
get epochStatuses - ViewDU 199.02 us/op 196.06 us/op 1.02
set epochStatuses - ListTreeView 1.4568 ms/op 1.4870 ms/op 0.98
set epochStatuses - ListTreeView - set() 433.33 us/op 428.31 us/op 1.01
set epochStatuses - ListTreeView - commit() 405.64 us/op 399.22 us/op 1.02
bitstring 639.98 ns/op 645.20 ns/op 0.99
bit mask 13.621 ns/op 13.595 ns/op 1.00
struct - increase slot to 1000000 927.93 us/op 928.22 us/op 1.00
UintNumberType - increase slot to 1000000 28.477 ms/op 28.482 ms/op 1.00
UintBigintType - increase slot to 1000000 412.46 ms/op 436.52 ms/op 0.94
UintBigint8 x 100000 tree_deserialize 4.8675 ms/op 4.7991 ms/op 1.01
UintBigint8 x 100000 tree_serialize 1.1840 ms/op 1.1908 ms/op 0.99
UintBigint16 x 100000 tree_deserialize 4.8692 ms/op 4.8965 ms/op 0.99
UintBigint16 x 100000 tree_serialize 1.1696 ms/op 1.2277 ms/op 0.95
UintBigint32 x 100000 tree_deserialize 5.1571 ms/op 4.9104 ms/op 1.05
UintBigint32 x 100000 tree_serialize 1.2394 ms/op 1.3207 ms/op 0.94
UintBigint64 x 100000 tree_deserialize 5.7712 ms/op 5.5974 ms/op 1.03
UintBigint64 x 100000 tree_serialize 1.6100 ms/op 1.6834 ms/op 0.96
UintBigint8 x 100000 value_deserialize 433.65 us/op 433.14 us/op 1.00
UintBigint8 x 100000 value_serialize 611.92 us/op 624.50 us/op 0.98
UintBigint16 x 100000 value_deserialize 469.53 us/op 469.52 us/op 1.00
UintBigint16 x 100000 value_serialize 650.88 us/op 665.25 us/op 0.98
UintBigint32 x 100000 value_deserialize 437.73 us/op 436.70 us/op 1.00
UintBigint32 x 100000 value_serialize 652.75 us/op 679.50 us/op 0.96
UintBigint64 x 100000 value_deserialize 466.08 us/op 466.75 us/op 1.00
UintBigint64 x 100000 value_serialize 831.62 us/op 873.46 us/op 0.95
UintBigint8 x 100000 deserialize 4.8316 ms/op 5.0061 ms/op 0.97
UintBigint8 x 100000 serialize 1.4651 ms/op 1.5161 ms/op 0.97
UintBigint16 x 100000 deserialize 4.6370 ms/op 4.9129 ms/op 0.94
UintBigint16 x 100000 serialize 1.4917 ms/op 1.5124 ms/op 0.99
UintBigint32 x 100000 deserialize 5.5162 ms/op 5.6090 ms/op 0.98
UintBigint32 x 100000 serialize 2.8652 ms/op 2.9267 ms/op 0.98
UintBigint64 x 100000 deserialize 4.0057 ms/op 3.9061 ms/op 1.03
UintBigint64 x 100000 serialize 1.5027 ms/op 1.4994 ms/op 1.00
UintBigint128 x 100000 deserialize 5.8688 ms/op 5.9063 ms/op 0.99
UintBigint128 x 100000 serialize 16.751 ms/op 18.068 ms/op 0.93
UintBigint256 x 100000 deserialize 10.747 ms/op 11.348 ms/op 0.95
UintBigint256 x 100000 serialize 50.095 ms/op 52.134 ms/op 0.96
Slice from Uint8Array x25000 1.0075 ms/op 1.0121 ms/op 1.00
Slice from ArrayBuffer x25000 17.315 ms/op 16.961 ms/op 1.02
Slice from ArrayBuffer x25000 + new Uint8Array 19.664 ms/op 18.343 ms/op 1.07
Copy Uint8Array 100000 iterate 816.22 us/op 805.99 us/op 1.01
Copy Uint8Array 100000 slice 92.420 us/op 90.656 us/op 1.02
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 93.462 us/op 90.636 us/op 1.03
Copy Buffer 100000 Uint8Array.prototype.slice.call 90.874 us/op 90.549 us/op 1.00
Copy Uint8Array 100000 slice + set 150.73 us/op 155.83 us/op 0.97
Copy Uint8Array 100000 subarray + set 88.679 us/op 90.799 us/op 0.98
Copy Uint8Array 100000 slice arrayBuffer 88.888 us/op 90.931 us/op 0.98
Uint64 deserialize 100000 - iterate Uint8Array 1.7467 ms/op 1.7466 ms/op 1.00
Uint64 deserialize 100000 - by Uint32A 1.7363 ms/op 1.7571 ms/op 0.99
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.7450 ms/op 1.7582 ms/op 0.99
Uint64 deserialize 100000 - by DataView.getBigUint64 4.9021 ms/op 5.2691 ms/op 0.93
Uint64 deserialize 100000 - by byte 65.109 ms/op 42.976 ms/op 1.52

by benchmarkbot/action

Copy link
Contributor

@twoeths twoeths left a comment

Choose a reason for hiding this comment

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

looks good to me, was thinking we can make a util to be used for compisite.ts, listComposite.ts and listBasic.ts but seems like they have different type

@g11tech g11tech merged commit 14c4457 into master Mar 6, 2024
8 checks passed
@g11tech g11tech deleted the cache-list-root branch March 6, 2024 11:31
@wemeetagain wemeetagain mentioned this pull request Mar 6, 2024
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