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

chore: migrate from mocha to vitest #422

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

chore: migrate from mocha to vitest #422

wants to merge 13 commits into from

Conversation

nazarhussain
Copy link
Contributor

Motivation

Use consistent dependencies and frameworks across the repos.

Description

  • One step towards supporting different JS runtimes
  • Move all unit tests to vitest
  • Move all browsers tests to vitest

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain self-assigned this Nov 11, 2024
@nazarhussain nazarhussain changed the title test: migrate from mocha to vitest chore: migrate from mocha to vitest Nov 11, 2024
Copy link

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d786006 Previous: e58781f Ratio
digestTwoHashObjects 50023 times 48.486 ms/op 48.243 ms/op 1.01
digest64 50023 times 54.619 ms/op 53.846 ms/op 1.01
digest 50023 times 56.616 ms/op 55.442 ms/op 1.02
input length 32 1.2470 us/op 1.2160 us/op 1.03
input length 64 1.3900 us/op 1.3420 us/op 1.04
input length 128 2.2770 us/op 2.2870 us/op 1.00
input length 256 3.4070 us/op 3.3970 us/op 1.00
input length 512 5.7050 us/op 5.6410 us/op 1.01
input length 1024 11.047 us/op 11.105 us/op 0.99
digest 1000000 times 874.24 ms/op 887.39 ms/op 0.99
hashObjectToByteArray 50023 times 1.7483 ms/op 1.7092 ms/op 1.02
byteArrayToHashObject 50023 times 2.3308 ms/op 2.3218 ms/op 1.00
digest64 200092 times 222.25 ms/op 219.70 ms/op 1.01
hash 200092 times using batchHash4UintArray64s 246.49 ms/op 237.40 ms/op 1.04
digest64HashObjects 200092 times 197.39 ms/op 197.01 ms/op 1.00
hash 200092 times using batchHash4HashObjectInputs 207.67 ms/op 202.27 ms/op 1.03
getGindicesAtDepth 4.3090 us/op 4.2090 us/op 1.02
iterateAtDepth 7.7860 us/op 7.6830 us/op 1.01
getGindexBits 477.00 ns/op 458.00 ns/op 1.04
gindexIterator 1.0530 us/op 1.0570 us/op 1.00
HashComputationLevel.push then loop 28.041 ms/op 26.744 ms/op 1.05
HashComputation[] push then loop 51.329 ms/op 49.699 ms/op 1.03
hash 2 Uint8Array 500000 times - as-sha256 547.38 ms/op 542.64 ms/op 1.01
hashTwoObjects 500000 times - as-sha256 498.74 ms/op 506.48 ms/op 0.98
executeHashComputations - as-sha256 47.863 ms/op 46.500 ms/op 1.03
hash 2 Uint8Array 500000 times - noble 1.2306 s/op 1.2005 s/op 1.03
hashTwoObjects 500000 times - noble 1.7497 s/op 1.7027 s/op 1.03
executeHashComputations - noble 42.051 ms/op 43.488 ms/op 0.97
hash 2 Uint8Array 500000 times - hashtree 226.87 ms/op 221.65 ms/op 1.02
hashTwoObjects 500000 times - hashtree 213.88 ms/op 210.11 ms/op 1.02
executeHashComputations - hashtree 12.259 ms/op 11.860 ms/op 1.03
getHashComputations 2.7648 ms/op 2.7888 ms/op 0.99
executeHashComputations 11.739 ms/op 12.028 ms/op 0.98
get root 17.351 ms/op 18.120 ms/op 0.96
getNodeH() x7812.5 avg hindex 12.179 us/op 11.963 us/op 1.02
getNodeH() x7812.5 index 0 6.2800 us/op 6.2460 us/op 1.01
getNodeH() x7812.5 index 7 6.2880 us/op 6.2880 us/op 1.00
getNodeH() x7812.5 index 7 with key array 6.2780 us/op 6.2660 us/op 1.00
new LeafNode() x7812.5 14.682 us/op 14.767 us/op 0.99
getHashComputations 250000 nodes 19.106 ms/op 19.834 ms/op 0.96
batchHash 250000 nodes 89.299 ms/op 88.667 ms/op 1.01
get root 250000 nodes 125.81 ms/op 115.88 ms/op 1.09
getHashComputations 500000 nodes 27.221 ms/op 26.421 ms/op 1.03
batchHash 500000 nodes 162.67 ms/op 167.13 ms/op 0.97
get root 500000 nodes 247.42 ms/op 229.90 ms/op 1.08
getHashComputations 1000000 nodes 55.144 ms/op 74.207 ms/op 0.74
batchHash 1000000 nodes 296.92 ms/op 359.23 ms/op 0.83
get root 1000000 nodes 478.33 ms/op 477.74 ms/op 1.00
multiproof - depth 15, 1 requested leaves 9.2160 us/op 8.2080 us/op 1.12
tree offset multiproof - depth 15, 1 requested leaves 20.168 us/op 18.153 us/op 1.11
compact multiproof - depth 15, 1 requested leaves 3.9160 us/op 3.5000 us/op 1.12
multiproof - depth 15, 2 requested leaves 12.999 us/op 11.886 us/op 1.09
tree offset multiproof - depth 15, 2 requested leaves 22.969 us/op 22.621 us/op 1.02
compact multiproof - depth 15, 2 requested leaves 4.1010 us/op 3.5070 us/op 1.17
multiproof - depth 15, 3 requested leaves 18.212 us/op 16.968 us/op 1.07
tree offset multiproof - depth 15, 3 requested leaves 29.507 us/op 29.267 us/op 1.01
compact multiproof - depth 15, 3 requested leaves 5.3710 us/op 4.1610 us/op 1.29
multiproof - depth 15, 4 requested leaves 23.792 us/op 23.212 us/op 1.02
tree offset multiproof - depth 15, 4 requested leaves 39.101 us/op 33.747 us/op 1.16
compact multiproof - depth 15, 4 requested leaves 6.1610 us/op 4.8340 us/op 1.27
packedRootsBytesToLeafNodes bytes 4000 offset 0 2.4260 us/op 1.9940 us/op 1.22
packedRootsBytesToLeafNodes bytes 4000 offset 1 2.3090 us/op 1.9880 us/op 1.16
packedRootsBytesToLeafNodes bytes 4000 offset 2 2.3080 us/op 2.0170 us/op 1.14
packedRootsBytesToLeafNodes bytes 4000 offset 3 2.3800 us/op 2.0030 us/op 1.19
subtreeFillToContents depth 40 count 250000 39.075 ms/op 44.179 ms/op 0.88
setRoot - gindexBitstring 10.449 ms/op 9.0113 ms/op 1.16
setRoot - gindex 11.085 ms/op 9.2688 ms/op 1.20
getRoot - gindexBitstring 2.7664 ms/op 2.4680 ms/op 1.12
getRoot - gindex 3.6395 ms/op 3.2010 ms/op 1.14
getHashObject then setHashObject 11.319 ms/op 9.8988 ms/op 1.14
setNodeWithFn 9.6326 ms/op 7.6070 ms/op 1.27
getNodeAtDepth depth 0 x100000 1.1399 ms/op 1.1146 ms/op 1.02
setNodeAtDepth depth 0 x100000 2.8525 ms/op 2.4256 ms/op 1.18
getNodesAtDepth depth 0 x100000 1.0535 ms/op 1.0526 ms/op 1.00
setNodesAtDepth depth 0 x100000 1.5145 ms/op 1.5199 ms/op 1.00
getNodeAtDepth depth 1 x100000 1.1807 ms/op 1.1876 ms/op 0.99
setNodeAtDepth depth 1 x100000 6.3408 ms/op 6.5339 ms/op 0.97
getNodesAtDepth depth 1 x100000 1.1761 ms/op 1.1782 ms/op 1.00
setNodesAtDepth depth 1 x100000 5.0181 ms/op 4.6101 ms/op 1.09
getNodeAtDepth depth 2 x100000 1.4558 ms/op 1.4553 ms/op 1.00
setNodeAtDepth depth 2 x100000 10.376 ms/op 9.0335 ms/op 1.15
getNodesAtDepth depth 2 x100000 18.750 ms/op 17.148 ms/op 1.09
setNodesAtDepth depth 2 x100000 15.498 ms/op 12.973 ms/op 1.19
tree.getNodesAtDepth - gindexes 9.3862 ms/op 7.5545 ms/op 1.24
tree.getNodesAtDepth - push all nodes 2.3407 ms/op 1.8291 ms/op 1.28
tree.getNodesAtDepth - navigation 235.21 us/op 235.13 us/op 1.00
tree.setNodesAtDepth - indexes 503.45 us/op 402.14 us/op 1.25
set at depth 8 575.00 ns/op 457.00 ns/op 1.26
set at depth 16 698.00 ns/op 590.00 ns/op 1.18
set at depth 32 1.1770 us/op 932.00 ns/op 1.26
iterateNodesAtDepth 8 256 14.656 us/op 13.012 us/op 1.13
getNodesAtDepth 8 256 3.6720 us/op 3.3990 us/op 1.08
iterateNodesAtDepth 16 65536 4.7629 ms/op 4.2236 ms/op 1.13
getNodesAtDepth 16 65536 2.0808 ms/op 1.5425 ms/op 1.35
iterateNodesAtDepth 32 250000 17.223 ms/op 15.836 ms/op 1.09
getNodesAtDepth 32 250000 5.0530 ms/op 4.2444 ms/op 1.19
iterateNodesAtDepth 40 250000 16.905 ms/op 15.697 ms/op 1.08
getNodesAtDepth 40 250000 5.1269 ms/op 4.3415 ms/op 1.18
250000 validators root getter 117.74 ms/op 116.32 ms/op 1.01
250000 validators batchHash() 109.09 ms/op 83.153 ms/op 1.31
250000 validators hashComputations 18.111 ms/op 17.111 ms/op 1.06
bitlist bytes to struct (120,90) 961.00 ns/op 912.00 ns/op 1.05
bitlist bytes to tree (120,90) 3.0230 us/op 3.7060 us/op 0.82
bitlist bytes to struct (2048,2048) 1.1730 us/op 1.3000 us/op 0.90
bitlist bytes to tree (2048,2048) 4.5420 us/op 4.1160 us/op 1.10
ByteListType - deserialize 8.9307 ms/op 7.6292 ms/op 1.17
BasicListType - deserialize 18.509 ms/op 17.349 ms/op 1.07
ByteListType - serialize 8.7567 ms/op 7.6450 ms/op 1.15
BasicListType - serialize 11.304 ms/op 10.296 ms/op 1.10
BasicListType - tree_convertToStruct 31.267 ms/op 29.534 ms/op 1.06
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 4.9045 ms/op 4.5576 ms/op 1.08
List[uint8, 68719476736] len 300000 ViewDU.get(i) 3.9466 ms/op 3.9833 ms/op 0.99
Array.push len 300000 empty Array - number 7.2866 ms/op 6.2896 ms/op 1.16
Array.set len 300000 from new Array - number 2.2302 ms/op 2.1278 ms/op 1.05
Array.set len 300000 - number 6.6772 ms/op 5.9731 ms/op 1.12
Uint8Array.set len 300000 507.31 us/op 486.54 us/op 1.04
Uint32Array.set len 300000 626.95 us/op 562.82 us/op 1.11
Container({a: uint8, b: uint8}) getViewDU x300000 60.817 ms/op 47.349 ms/op 1.28
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 12.321 ms/op 10.823 ms/op 1.14
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 218.42 ms/op 210.41 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 256.14 ms/op 241.62 ms/op 1.06
List(Container) len 300000 ViewDU.get(i) 7.2241 ms/op 6.6224 ms/op 1.09
List(Container) len 300000 ViewDU.getReadonly(i) 6.7202 ms/op 6.3623 ms/op 1.06
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 34.503 ms/op 38.805 ms/op 0.89
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.9438 ms/op 4.5938 ms/op 1.29
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.4030 ms/op 6.0350 ms/op 1.06
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.1268 ms/op 5.9905 ms/op 1.02
Array.push len 300000 empty Array - object 6.7774 ms/op 6.0831 ms/op 1.11
Array.set len 300000 from new Array - object 2.3711 ms/op 2.0601 ms/op 1.15
Array.set len 300000 - object 6.9375 ms/op 5.8596 ms/op 1.18
cachePermanentRootStruct no cache 5.5460 us/op 5.4530 us/op 1.02
cachePermanentRootStruct with cache 227.00 ns/op 198.00 ns/op 1.15
epochParticipation len 250000 rws 7813 2.1935 ms/op 2.2599 ms/op 0.97
BeaconState ViewDU hashTreeRoot() vc=200000 107.57 ms/op 105.82 ms/op 1.02
BeaconState ViewDU recursive hash - commit step vc=200000 4.3579 ms/op 4.4781 ms/op 0.97
BeaconState ViewDU validator tree creation vc=10000 36.653 ms/op 36.296 ms/op 1.01
BeaconState ViewDU batchHashTreeRoot vc=200000 98.955 ms/op 95.770 ms/op 1.03
BeaconState ViewDU hashTreeRoot - commit step vc=200000 84.365 ms/op 83.425 ms/op 1.01
BeaconState ViewDU hashTreeRoot - hash step vc=200000 17.122 ms/op 15.702 ms/op 1.09
deserialize Attestation - tree 4.5140 us/op 4.6820 us/op 0.96
deserialize Attestation - struct 2.1010 us/op 1.8740 us/op 1.12
deserialize SignedAggregateAndProof - tree 4.0520 us/op 3.9380 us/op 1.03
deserialize SignedAggregateAndProof - struct 3.4360 us/op 2.8760 us/op 1.19
deserialize SyncCommitteeMessage - tree 1.1690 us/op 1.1190 us/op 1.04
deserialize SyncCommitteeMessage - struct 1.0630 us/op 1.0660 us/op 1.00
deserialize SignedContributionAndProof - tree 2.2450 us/op 2.1980 us/op 1.02
deserialize SignedContributionAndProof - struct 2.5470 us/op 2.4530 us/op 1.04
deserialize SignedBeaconBlock - tree 230.88 us/op 220.45 us/op 1.05
deserialize SignedBeaconBlock - struct 134.88 us/op 120.94 us/op 1.12
BeaconState vc 300000 - deserialize tree 631.92 ms/op 625.35 ms/op 1.01
BeaconState vc 300000 - serialize tree 105.46 ms/op 167.11 ms/op 0.63
BeaconState.historicalRoots vc 300000 - deserialize tree 734.00 ns/op 740.00 ns/op 0.99
BeaconState.historicalRoots vc 300000 - serialize tree 745.00 ns/op 661.00 ns/op 1.13
BeaconState.validators vc 300000 - deserialize tree 586.79 ms/op 594.08 ms/op 0.99
BeaconState.validators vc 300000 - serialize tree 102.88 ms/op 102.95 ms/op 1.00
BeaconState.balances vc 300000 - deserialize tree 24.541 ms/op 23.774 ms/op 1.03
BeaconState.balances vc 300000 - serialize tree 4.0170 ms/op 3.5483 ms/op 1.13
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 457.18 us/op 407.23 us/op 1.12
BeaconState.previousEpochParticipation vc 300000 - serialize tree 302.56 us/op 300.47 us/op 1.01
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 478.22 us/op 367.26 us/op 1.30
BeaconState.currentEpochParticipation vc 300000 - serialize tree 302.40 us/op 303.44 us/op 1.00
BeaconState.inactivityScores vc 300000 - deserialize tree 16.485 ms/op 23.701 ms/op 0.70
BeaconState.inactivityScores vc 300000 - serialize tree 4.5187 ms/op 3.5339 ms/op 1.28
hashTreeRoot Attestation - struct 23.750 us/op 19.038 us/op 1.25
hashTreeRoot Attestation - tree 9.7550 us/op 9.1270 us/op 1.07
hashTreeRoot SignedAggregateAndProof - struct 28.161 us/op 24.357 us/op 1.16
hashTreeRoot SignedAggregateAndProof - tree 13.323 us/op 12.946 us/op 1.03
hashTreeRoot SyncCommitteeMessage - struct 7.1260 us/op 6.2560 us/op 1.14
hashTreeRoot SyncCommitteeMessage - tree 3.2720 us/op 3.1830 us/op 1.03
hashTreeRoot SignedContributionAndProof - struct 16.672 us/op 16.508 us/op 1.01
hashTreeRoot SignedContributionAndProof - tree 9.1360 us/op 8.8250 us/op 1.04
hashTreeRoot SignedBeaconBlock - struct 1.4773 ms/op 1.2691 ms/op 1.16
hashTreeRoot SignedBeaconBlock - tree 796.49 us/op 763.79 us/op 1.04
hashTreeRoot Validator - struct 8.4680 us/op 7.6760 us/op 1.10
hashTreeRoot Validator - tree 6.8330 us/op 6.6460 us/op 1.03
BeaconState vc 300000 - hashTreeRoot tree 2.1996 s/op 2.1538 s/op 1.02
BeaconState vc 300000 - batchHashTreeRoot tree 3.6385 s/op 3.5603 s/op 1.02
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.0280 us/op 1.0680 us/op 0.96
BeaconState.validators vc 300000 - hashTreeRoot tree 2.2287 s/op 2.1477 s/op 1.04
BeaconState.balances vc 300000 - hashTreeRoot tree 33.666 ms/op 32.837 ms/op 1.03
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.1979 ms/op 4.2665 ms/op 0.98
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.2346 ms/op 4.1114 ms/op 1.03
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 33.580 ms/op 33.516 ms/op 1.00
hash64 x18 9.3350 us/op 9.2410 us/op 1.01
hashTwoObjects x18 8.8550 us/op 8.7090 us/op 1.02
hash64 x1740 847.67 us/op 877.38 us/op 0.97
hashTwoObjects x1740 809.19 us/op 813.89 us/op 0.99
hash64 x2700000 1.3317 s/op 1.3210 s/op 1.01
hashTwoObjects x2700000 1.2491 s/op 1.2764 s/op 0.98
get_exitEpoch - ContainerType 254.00 ns/op 369.00 ns/op 0.69
get_exitEpoch - ContainerNodeStructType 265.00 ns/op 388.00 ns/op 0.68
set_exitEpoch - ContainerType 278.00 ns/op 388.00 ns/op 0.72
set_exitEpoch - ContainerNodeStructType 273.00 ns/op 390.00 ns/op 0.70
get_pubkey - ContainerType 877.00 ns/op 1.4530 us/op 0.60
get_pubkey - ContainerNodeStructType 260.00 ns/op 368.00 ns/op 0.71
hashTreeRoot - ContainerType 448.00 ns/op 653.00 ns/op 0.69
hashTreeRoot - ContainerNodeStructType 473.00 ns/op 675.00 ns/op 0.70
createProof - ContainerType 4.3650 us/op 6.4280 us/op 0.68
createProof - ContainerNodeStructType 21.606 us/op 27.037 us/op 0.80
serialize - ContainerType 2.0420 us/op 2.1310 us/op 0.96
serialize - ContainerNodeStructType 1.6070 us/op 1.6440 us/op 0.98
set_exitEpoch_and_hashTreeRoot - ContainerType 2.8200 us/op 2.7420 us/op 1.03
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 7.5040 us/op 8.0520 us/op 0.93
Array - for of 5.5740 us/op 7.0080 us/op 0.80
Array - for(;;) 5.5660 us/op 7.1820 us/op 0.77
basicListValue.readonlyValuesArray() 4.4550 ms/op 4.3980 ms/op 1.01
basicListValue.readonlyValuesArray() + loop all 4.9554 ms/op 4.6682 ms/op 1.06
compositeListValue.readonlyValuesArray() 29.880 ms/op 30.292 ms/op 0.99
compositeListValue.readonlyValuesArray() + loop all 30.275 ms/op 30.032 ms/op 1.01
Number64UintType - get balances list 4.2698 ms/op 4.2023 ms/op 1.02
Number64UintType - set balances list 9.9172 ms/op 9.9380 ms/op 1.00
Number64UintType - get and increase 10 then set 39.718 ms/op 40.902 ms/op 0.97
Number64UintType - increase 10 using applyDelta 16.770 ms/op 16.656 ms/op 1.01
Number64UintType - increase 10 using applyDeltaInBatch 16.724 ms/op 17.329 ms/op 0.97
tree_newTreeFromUint64Deltas 17.787 ms/op 17.262 ms/op 1.03
unsafeUint8ArrayToTree 34.983 ms/op 33.193 ms/op 1.05
bitLength(50) 251.00 ns/op 224.00 ns/op 1.12
bitLengthStr(50) 232.00 ns/op 207.00 ns/op 1.12
bitLength(8000) 232.00 ns/op 211.00 ns/op 1.10
bitLengthStr(8000) 269.00 ns/op 258.00 ns/op 1.04
bitLength(250000) 243.00 ns/op 214.00 ns/op 1.14
bitLengthStr(250000) 298.00 ns/op 291.00 ns/op 1.02
floor - Math.floor (53) 1.2361 ns/op 1.2370 ns/op 1.00
floor - << 0 (53) 1.2539 ns/op 1.2561 ns/op 1.00
floor - Math.floor (512) 1.2367 ns/op 1.2367 ns/op 1.00
floor - << 0 (512) 1.2420 ns/op 1.2368 ns/op 1.00
fnIf(0) 1.5480 ns/op 1.5464 ns/op 1.00
fnSwitch(0) 2.1633 ns/op 2.1655 ns/op 1.00
fnObj(0) 1.5466 ns/op 1.5556 ns/op 0.99
fnArr(0) 1.5471 ns/op 1.5466 ns/op 1.00
fnIf(4) 2.1683 ns/op 2.1664 ns/op 1.00
fnSwitch(4) 2.1641 ns/op 2.1706 ns/op 1.00
fnObj(4) 1.5760 ns/op 1.5537 ns/op 1.01
fnArr(4) 1.5477 ns/op 1.5485 ns/op 1.00
fnIf(9) 3.0911 ns/op 3.0934 ns/op 1.00
fnSwitch(9) 2.1665 ns/op 2.1642 ns/op 1.00
fnObj(9) 1.5468 ns/op 1.5494 ns/op 1.00
fnArr(9) 1.5457 ns/op 1.5478 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.32 us/op 123.81 us/op 1.00
Container {a,b,vec} - as tree x100000 340.23 us/op 341.54 us/op 1.00
Container {a,vec,b} - as struct x100000 155.52 us/op 154.75 us/op 1.00
Container {a,vec,b} - as tree x100000 372.67 us/op 372.31 us/op 1.00
get 2 props x1000000 - rawObject 309.13 us/op 309.63 us/op 1.00
get 2 props x1000000 - proxy 88.809 ms/op 73.740 ms/op 1.20
get 2 props x1000000 - customObj 310.66 us/op 310.61 us/op 1.00
Simple object binary -> struct 585.00 ns/op 689.00 ns/op 0.85
Simple object binary -> tree_backed 1.1590 us/op 1.3410 us/op 0.86
Simple object struct -> tree_backed 1.5740 us/op 1.9630 us/op 0.80
Simple object tree_backed -> struct 1.5750 us/op 1.8540 us/op 0.85
Simple object struct -> binary 839.00 ns/op 933.00 ns/op 0.90
Simple object tree_backed -> binary 1.3410 us/op 1.5790 us/op 0.85
aggregationBits binary -> struct 486.00 ns/op 599.00 ns/op 0.81
aggregationBits binary -> tree_backed 2.0470 us/op 2.4590 us/op 0.83
aggregationBits struct -> tree_backed 2.4560 us/op 2.8520 us/op 0.86
aggregationBits tree_backed -> struct 1.0080 us/op 1.2490 us/op 0.81
aggregationBits struct -> binary 731.00 ns/op 798.00 ns/op 0.92
aggregationBits tree_backed -> binary 928.00 ns/op 1.0790 us/op 0.86
List(uint8) 100000 binary -> struct 1.5525 ms/op 1.4515 ms/op 1.07
List(uint8) 100000 binary -> tree_backed 98.850 us/op 96.619 us/op 1.02
List(uint8) 100000 struct -> tree_backed 1.2338 ms/op 1.2458 ms/op 0.99
List(uint8) 100000 tree_backed -> struct 1.1156 ms/op 1.0206 ms/op 1.09
List(uint8) 100000 struct -> binary 1.0058 ms/op 1.0383 ms/op 0.97
List(uint8) 100000 tree_backed -> binary 95.239 us/op 96.603 us/op 0.99
List(uint64Number) 100000 binary -> struct 1.3201 ms/op 1.2164 ms/op 1.09
List(uint64Number) 100000 binary -> tree_backed 2.6687 ms/op 3.3339 ms/op 0.80
List(uint64Number) 100000 struct -> tree_backed 4.7812 ms/op 4.8758 ms/op 0.98
List(uint64Number) 100000 tree_backed -> struct 2.3209 ms/op 2.4317 ms/op 0.95
List(uint64Number) 100000 struct -> binary 1.5214 ms/op 1.5224 ms/op 1.00
List(uint64Number) 100000 tree_backed -> binary 949.36 us/op 932.48 us/op 1.02
List(Uint64Bigint) 100000 binary -> struct 3.8035 ms/op 3.7286 ms/op 1.02
List(Uint64Bigint) 100000 binary -> tree_backed 3.5437 ms/op 3.6569 ms/op 0.97
List(Uint64Bigint) 100000 struct -> tree_backed 5.9846 ms/op 5.9455 ms/op 1.01
List(Uint64Bigint) 100000 tree_backed -> struct 4.7067 ms/op 4.6791 ms/op 1.01
List(Uint64Bigint) 100000 struct -> binary 2.1066 ms/op 2.1101 ms/op 1.00
List(Uint64Bigint) 100000 tree_backed -> binary 1.0192 ms/op 944.46 us/op 1.08
Vector(Root) 100000 binary -> struct 34.746 ms/op 33.530 ms/op 1.04
Vector(Root) 100000 binary -> tree_backed 33.333 ms/op 31.990 ms/op 1.04
Vector(Root) 100000 struct -> tree_backed 45.447 ms/op 42.422 ms/op 1.07
Vector(Root) 100000 tree_backed -> struct 52.000 ms/op 48.678 ms/op 1.07
Vector(Root) 100000 struct -> binary 2.8702 ms/op 2.7790 ms/op 1.03
Vector(Root) 100000 tree_backed -> binary 9.3503 ms/op 8.6419 ms/op 1.08
List(Validator) 100000 binary -> struct 100.48 ms/op 97.990 ms/op 1.03
List(Validator) 100000 binary -> tree_backed 313.49 ms/op 307.53 ms/op 1.02
List(Validator) 100000 struct -> tree_backed 330.93 ms/op 324.32 ms/op 1.02
List(Validator) 100000 tree_backed -> struct 226.04 ms/op 215.93 ms/op 1.05
List(Validator) 100000 struct -> binary 27.792 ms/op 27.645 ms/op 1.01
List(Validator) 100000 tree_backed -> binary 126.33 ms/op 114.41 ms/op 1.10
List(Validator-NS) 100000 binary -> struct 116.71 ms/op 104.51 ms/op 1.12
List(Validator-NS) 100000 binary -> tree_backed 155.91 ms/op 151.08 ms/op 1.03
List(Validator-NS) 100000 struct -> tree_backed 197.99 ms/op 193.18 ms/op 1.02
List(Validator-NS) 100000 tree_backed -> struct 175.17 ms/op 168.29 ms/op 1.04
List(Validator-NS) 100000 struct -> binary 27.431 ms/op 28.062 ms/op 0.98
List(Validator-NS) 100000 tree_backed -> binary 33.272 ms/op 32.705 ms/op 1.02
get epochStatuses - MutableVector 95.094 us/op 108.56 us/op 0.88
get epochStatuses - ViewDU 203.40 us/op 202.53 us/op 1.00
set epochStatuses - ListTreeView 2.5114 ms/op 2.4053 ms/op 1.04
set epochStatuses - ListTreeView - set() 474.86 us/op 454.94 us/op 1.04
set epochStatuses - ListTreeView - commit() 520.39 us/op 556.67 us/op 0.93
bitstring 644.92 ns/op 645.94 ns/op 1.00
bit mask 14.491 ns/op 13.679 ns/op 1.06
struct - increase slot to 1000000 928.27 us/op 928.36 us/op 1.00
UintNumberType - increase slot to 1000000 21.448 ms/op 21.413 ms/op 1.00
UintBigintType - increase slot to 1000000 165.52 ms/op 169.23 ms/op 0.98
UintBigint8 x 100000 tree_deserialize 4.7202 ms/op 5.0115 ms/op 0.94
UintBigint8 x 100000 tree_serialize 1.1532 ms/op 1.1549 ms/op 1.00
UintBigint16 x 100000 tree_deserialize 5.6340 ms/op 5.0486 ms/op 1.12
UintBigint16 x 100000 tree_serialize 1.2723 ms/op 1.2855 ms/op 0.99
UintBigint32 x 100000 tree_deserialize 5.5104 ms/op 5.4270 ms/op 1.02
UintBigint32 x 100000 tree_serialize 1.2723 ms/op 1.2925 ms/op 0.98
UintBigint64 x 100000 tree_deserialize 7.1132 ms/op 5.6486 ms/op 1.26
UintBigint64 x 100000 tree_serialize 1.7434 ms/op 1.7295 ms/op 1.01
UintBigint8 x 100000 value_deserialize 438.80 us/op 433.66 us/op 1.01
UintBigint8 x 100000 value_serialize 728.25 us/op 718.01 us/op 1.01
UintBigint16 x 100000 value_deserialize 482.15 us/op 464.07 us/op 1.04
UintBigint16 x 100000 value_serialize 761.74 us/op 757.82 us/op 1.01
UintBigint32 x 100000 value_deserialize 433.19 us/op 438.91 us/op 0.99
UintBigint32 x 100000 value_serialize 786.08 us/op 793.66 us/op 0.99
UintBigint64 x 100000 value_deserialize 496.83 us/op 497.38 us/op 1.00
UintBigint64 x 100000 value_serialize 983.69 us/op 980.81 us/op 1.00
UintBigint8 x 100000 deserialize 3.1367 ms/op 3.3464 ms/op 0.94
UintBigint8 x 100000 serialize 1.7242 ms/op 1.9069 ms/op 0.90
UintBigint16 x 100000 deserialize 3.3265 ms/op 3.2067 ms/op 1.04
UintBigint16 x 100000 serialize 1.6756 ms/op 1.5547 ms/op 1.08
UintBigint32 x 100000 deserialize 3.4095 ms/op 3.2863 ms/op 1.04
UintBigint32 x 100000 serialize 2.8117 ms/op 2.8053 ms/op 1.00
UintBigint64 x 100000 deserialize 4.1293 ms/op 4.1025 ms/op 1.01
UintBigint64 x 100000 serialize 1.5480 ms/op 1.5834 ms/op 0.98
UintBigint128 x 100000 deserialize 5.8678 ms/op 5.5703 ms/op 1.05
UintBigint128 x 100000 serialize 14.891 ms/op 14.282 ms/op 1.04
UintBigint256 x 100000 deserialize 9.0689 ms/op 8.4595 ms/op 1.07
UintBigint256 x 100000 serialize 44.173 ms/op 42.168 ms/op 1.05
Slice from Uint8Array x25000 1.3236 ms/op 1.3334 ms/op 0.99
Slice from ArrayBuffer x25000 16.574 ms/op 16.053 ms/op 1.03
Slice from ArrayBuffer x25000 + new Uint8Array 18.235 ms/op 17.122 ms/op 1.07
Copy Uint8Array 100000 iterate 2.6115 ms/op 2.7648 ms/op 0.94
Copy Uint8Array 100000 slice 112.89 us/op 100.46 us/op 1.12
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 113.44 us/op 100.26 us/op 1.13
Copy Buffer 100000 Uint8Array.prototype.slice.call 113.08 us/op 101.05 us/op 1.12
Copy Uint8Array 100000 slice + set 181.26 us/op 174.30 us/op 1.04
Copy Uint8Array 100000 subarray + set 112.44 us/op 97.907 us/op 1.15
Copy Uint8Array 100000 slice arrayBuffer 114.05 us/op 101.14 us/op 1.13
Uint64 deserialize 100000 - iterate Uint8Array 1.8890 ms/op 1.7850 ms/op 1.06
Uint64 deserialize 100000 - by Uint32A 1.9545 ms/op 1.9250 ms/op 1.02
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.9623 ms/op 1.8148 ms/op 1.08
Uint64 deserialize 100000 - by DataView.getBigUint64 5.0053 ms/op 4.8491 ms/op 1.03
Uint64 deserialize 100000 - by byte 40.367 ms/op 40.511 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