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

test: migrate types unit tests to vitest #6224

Merged
merged 2 commits into from
Dec 28, 2023
Merged

Conversation

nazarhussain
Copy link
Contributor

Motivation

Consolidate the testing frameworks and migrate to vitest.

Description

Migrate types package tests to vitest.

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner December 21, 2023 15:56
@nazarhussain nazarhussain self-assigned this Dec 21, 2023
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Merging #6224 (4e24b98) into unstable (1200c59) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6224   +/-   ##
=========================================
  Coverage     80.95%   80.95%           
=========================================
  Files           185      185           
  Lines         17935    17935           
  Branches       1078     1078           
=========================================
  Hits          14519    14519           
  Misses         3389     3389           
  Partials         27       27           

Copy link
Contributor

github-actions bot commented Dec 21, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 0b1a8dd Previous: 21851b2 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0033 ms/op 615.36 us/op 1.63
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 81.996 us/op 95.245 us/op 0.86
BLS verify - blst-native 1.3087 ms/op 1.2389 ms/op 1.06
BLS verifyMultipleSignatures 3 - blst-native 2.7435 ms/op 2.6019 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst-native 6.0387 ms/op 5.7142 ms/op 1.06
BLS verifyMultipleSignatures 32 - blst-native 22.072 ms/op 20.859 ms/op 1.06
BLS verifyMultipleSignatures 64 - blst-native 42.990 ms/op 41.072 ms/op 1.05
BLS verifyMultipleSignatures 128 - blst-native 86.649 ms/op 81.548 ms/op 1.06
BLS deserializing 10000 signatures 932.81 ms/op 919.16 ms/op 1.01
BLS deserializing 100000 signatures 9.2102 s/op 9.3253 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3323 ms/op 1.3341 ms/op 1.00
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.6156 ms/op 1.4556 ms/op 1.11
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.8720 ms/op 2.2501 ms/op 1.28
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.3171 ms/op 4.3921 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.6763 ms/op 7.3747 ms/op 1.04
BLS aggregatePubkeys 32 - blst-native 25.385 us/op 26.812 us/op 0.95
BLS aggregatePubkeys 128 - blst-native 99.953 us/op 95.168 us/op 1.05
getAttestationsForBlock 49.266 ms/op 46.084 ms/op 1.07
getSlashingsAndExits - default max 193.25 us/op 207.10 us/op 0.93
getSlashingsAndExits - 2k 364.24 us/op 377.97 us/op 0.96
proposeBlockBody type=full, size=empty 5.4238 ms/op 5.0774 ms/op 1.07
isKnown best case - 1 super set check 310.00 ns/op 319.00 ns/op 0.97
isKnown normal case - 2 super set checks 303.00 ns/op 305.00 ns/op 0.99
isKnown worse case - 16 super set checks 295.00 ns/op 296.00 ns/op 1.00
CheckpointStateCache - add get delete 5.7910 us/op 6.1240 us/op 0.95
validate api signedAggregateAndProof - struct 2.7488 ms/op 2.7432 ms/op 1.00
validate gossip signedAggregateAndProof - struct 2.7675 ms/op 2.7489 ms/op 1.01
validate gossip attestation - vc 640000 1.3461 ms/op 1.2979 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 159.96 us/op 149.92 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 64 139.92 us/op 131.21 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 128 131.26 us/op 122.86 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 256 131.78 us/op 127.92 us/op 1.03
pickEth1Vote - no votes 1.2081 ms/op 1.1132 ms/op 1.09
pickEth1Vote - max votes 7.8798 ms/op 7.5560 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.636 ms/op 14.769 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.663 ms/op 29.592 ms/op 0.87
pickEth1Vote - Eth1Data fastSerialize value x2048 571.72 us/op 588.91 us/op 0.97
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.1906 ms/op 7.7319 ms/op 0.54
bytes32 toHexString 475.00 ns/op 512.00 ns/op 0.93
bytes32 Buffer.toString(hex) 286.00 ns/op 294.00 ns/op 0.97
bytes32 Buffer.toString(hex) from Uint8Array 426.00 ns/op 434.00 ns/op 0.98
bytes32 Buffer.toString(hex) + 0x 283.00 ns/op 288.00 ns/op 0.98
Object access 1 prop 0.15500 ns/op 0.14900 ns/op 1.04
Map access 1 prop 0.14500 ns/op 0.14000 ns/op 1.04
Object get x1000 7.6920 ns/op 6.7200 ns/op 1.14
Map get x1000 0.76000 ns/op 0.71000 ns/op 1.07
Object set x1000 50.635 ns/op 48.052 ns/op 1.05
Map set x1000 39.192 ns/op 36.418 ns/op 1.08
Return object 10000 times 0.24520 ns/op 0.22640 ns/op 1.08
Throw Error 10000 times 3.8488 us/op 3.6870 us/op 1.04
fastMsgIdFn sha256 / 200 bytes 3.2740 us/op 3.1000 us/op 1.06
fastMsgIdFn h32 xxhash / 200 bytes 277.00 ns/op 271.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 200 bytes 340.00 ns/op 331.00 ns/op 1.03
fastMsgIdFn sha256 / 1000 bytes 11.372 us/op 10.912 us/op 1.04
fastMsgIdFn h32 xxhash / 1000 bytes 399.00 ns/op 394.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 1000 bytes 416.00 ns/op 409.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 103.61 us/op 101.69 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.9720 us/op 1.8610 us/op 1.06
fastMsgIdFn h64 xxhash / 10000 bytes 1.3650 us/op 1.2810 us/op 1.07
send data - 1000 256B messages 18.057 ms/op 17.802 ms/op 1.01
send data - 1000 512B messages 25.467 ms/op 24.872 ms/op 1.02
send data - 1000 1024B messages 40.025 ms/op 39.172 ms/op 1.02
send data - 1000 1200B messages 36.341 ms/op 35.451 ms/op 1.03
send data - 1000 2048B messages 42.686 ms/op 43.475 ms/op 0.98
send data - 1000 4096B messages 41.309 ms/op 41.283 ms/op 1.00
send data - 1000 16384B messages 109.84 ms/op 121.26 ms/op 0.91
send data - 1000 65536B messages 454.36 ms/op 459.39 ms/op 0.99
enrSubnets - fastDeserialize 64 bits 1.2020 us/op 1.2510 us/op 0.96
enrSubnets - ssz BitVector 64 bits 390.00 ns/op 400.00 ns/op 0.97
enrSubnets - fastDeserialize 4 bits 167.00 ns/op 163.00 ns/op 1.02
enrSubnets - ssz BitVector 4 bits 393.00 ns/op 401.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 92.177 us/op 96.558 us/op 0.95
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 118.92 us/op 120.13 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 154.81 us/op 155.26 us/op 1.00
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 273.57 us/op 274.51 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 324.80 us/op 320.00 us/op 1.01
array of 16000 items push then shift 1.5321 us/op 1.5285 us/op 1.00
LinkedList of 16000 items push then shift 8.6880 ns/op 8.6110 ns/op 1.01
array of 16000 items push then pop 87.097 ns/op 95.217 ns/op 0.91
LinkedList of 16000 items push then pop 8.6380 ns/op 8.3580 ns/op 1.03
array of 24000 items push then shift 2.3884 us/op 2.2798 us/op 1.05
LinkedList of 24000 items push then shift 8.8680 ns/op 8.5900 ns/op 1.03
array of 24000 items push then pop 102.18 ns/op 118.42 ns/op 0.86
LinkedList of 24000 items push then pop 8.4550 ns/op 8.3040 ns/op 1.02
intersect bitArray bitLen 8 6.2230 ns/op 6.1670 ns/op 1.01
intersect array and set length 8 60.357 ns/op 60.049 ns/op 1.01
intersect bitArray bitLen 128 32.901 ns/op 32.352 ns/op 1.02
intersect array and set length 128 829.52 ns/op 821.50 ns/op 1.01
bitArray.getTrueBitIndexes() bitLen 128 1.4620 us/op 1.3350 us/op 1.10
bitArray.getTrueBitIndexes() bitLen 248 2.4350 us/op 2.3160 us/op 1.05
bitArray.getTrueBitIndexes() bitLen 512 4.7420 us/op 4.4990 us/op 1.05
Buffer.concat 32 items 1.0020 us/op 962.00 ns/op 1.04
Uint8Array.set 32 items 1.9240 us/op 2.0460 us/op 0.94
Set add up to 64 items then delete first 4.2432 us/op 4.1328 us/op 1.03
OrderedSet add up to 64 items then delete first 5.3511 us/op 5.2288 us/op 1.02
Set add up to 64 items then delete last 4.5905 us/op 4.4183 us/op 1.04
OrderedSet add up to 64 items then delete last 5.9299 us/op 5.5054 us/op 1.08
Set add up to 64 items then delete middle 4.5229 us/op 4.4037 us/op 1.03
OrderedSet add up to 64 items then delete middle 7.1357 us/op 6.7323 us/op 1.06
Set add up to 128 items then delete first 9.0478 us/op 8.9456 us/op 1.01
OrderedSet add up to 128 items then delete first 11.467 us/op 11.913 us/op 0.96
Set add up to 128 items then delete last 9.0772 us/op 8.8483 us/op 1.03
OrderedSet add up to 128 items then delete last 12.035 us/op 11.151 us/op 1.08
Set add up to 128 items then delete middle 8.9687 us/op 8.7195 us/op 1.03
OrderedSet add up to 128 items then delete middle 16.994 us/op 16.296 us/op 1.04
Set add up to 256 items then delete first 17.965 us/op 17.949 us/op 1.00
OrderedSet add up to 256 items then delete first 23.702 us/op 24.149 us/op 0.98
Set add up to 256 items then delete last 17.995 us/op 17.440 us/op 1.03
OrderedSet add up to 256 items then delete last 24.253 us/op 22.509 us/op 1.08
Set add up to 256 items then delete middle 18.169 us/op 18.312 us/op 0.99
OrderedSet add up to 256 items then delete middle 45.032 us/op 45.203 us/op 1.00
transfer serialized Status (84 B) 1.6950 us/op 1.8680 us/op 0.91
copy serialized Status (84 B) 1.5560 us/op 1.5170 us/op 1.03
transfer serialized SignedVoluntaryExit (112 B) 2.0910 us/op 2.1390 us/op 0.98
copy serialized SignedVoluntaryExit (112 B) 1.7030 us/op 1.6890 us/op 1.01
transfer serialized ProposerSlashing (416 B) 3.0830 us/op 3.0860 us/op 1.00
copy serialized ProposerSlashing (416 B) 3.2720 us/op 2.9530 us/op 1.11
transfer serialized Attestation (485 B) 3.2740 us/op 3.2240 us/op 1.02
copy serialized Attestation (485 B) 3.3220 us/op 3.0250 us/op 1.10
transfer serialized AttesterSlashing (33232 B) 3.3330 us/op 3.1840 us/op 1.05
copy serialized AttesterSlashing (33232 B) 6.7020 us/op 6.6390 us/op 1.01
transfer serialized Small SignedBeaconBlock (128000 B) 3.4190 us/op 3.5620 us/op 0.96
copy serialized Small SignedBeaconBlock (128000 B) 14.736 us/op 15.109 us/op 0.98
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3590 us/op 3.8530 us/op 0.87
copy serialized Avg SignedBeaconBlock (200000 B) 19.331 us/op 21.680 us/op 0.89
transfer serialized BlobsSidecar (524380 B) 3.0190 us/op 3.5140 us/op 0.86
copy serialized BlobsSidecar (524380 B) 102.01 us/op 83.823 us/op 1.22
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3670 us/op 3.4930 us/op 0.96
copy serialized Big SignedBeaconBlock (1000000 B) 380.64 us/op 160.46 us/op 2.37
pass gossip attestations to forkchoice per slot 4.1716 ms/op 4.2403 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 674.02 us/op 670.52 us/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 0 4.6547 ms/op 4.2027 ms/op 1.11
forkChoice updateHead vc 1000000 bc 64 eq 0 7.0245 ms/op 7.1951 ms/op 0.98
forkChoice updateHead vc 600000 bc 320 eq 0 4.0888 ms/op 4.1288 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 4.3630 ms/op 4.2175 ms/op 1.03
forkChoice updateHead vc 600000 bc 7200 eq 0 5.2392 ms/op 5.2255 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 1000 11.265 ms/op 11.063 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 11.632 ms/op 11.786 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 15.866 ms/op 16.164 ms/op 0.98
computeDeltas 500000 validators 300 proto nodes 6.6541 ms/op 6.4534 ms/op 1.03
computeDeltas 500000 validators 1200 proto nodes 6.6542 ms/op 6.4223 ms/op 1.04
computeDeltas 500000 validators 7200 proto nodes 6.3362 ms/op 6.3033 ms/op 1.01
computeDeltas 750000 validators 300 proto nodes 9.8265 ms/op 9.5391 ms/op 1.03
computeDeltas 750000 validators 1200 proto nodes 9.6583 ms/op 9.6517 ms/op 1.00
computeDeltas 750000 validators 7200 proto nodes 9.7331 ms/op 9.4145 ms/op 1.03
computeDeltas 1400000 validators 300 proto nodes 18.679 ms/op 18.845 ms/op 0.99
computeDeltas 1400000 validators 1200 proto nodes 18.875 ms/op 19.937 ms/op 0.95
computeDeltas 1400000 validators 7200 proto nodes 18.925 ms/op 18.742 ms/op 1.01
computeDeltas 2100000 validators 300 proto nodes 28.542 ms/op 28.024 ms/op 1.02
computeDeltas 2100000 validators 1200 proto nodes 28.554 ms/op 27.220 ms/op 1.05
computeDeltas 2100000 validators 7200 proto nodes 28.012 ms/op 27.543 ms/op 1.02
computeProposerBoostScoreFromBalances 500000 validators 3.7975 ms/op 3.7386 ms/op 1.02
computeProposerBoostScoreFromBalances 750000 validators 3.7953 ms/op 3.6777 ms/op 1.03
computeProposerBoostScoreFromBalances 1400000 validators 3.7608 ms/op 3.7279 ms/op 1.01
computeProposerBoostScoreFromBalances 2100000 validators 3.7180 ms/op 3.7609 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 2.2076 ms/op 2.2848 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei worstcase 3.3215 ms/op 3.4120 ms/op 0.97
altair processAttestation - setStatus - 1/6 committees join 163.29 us/op 181.00 us/op 0.90
altair processAttestation - setStatus - 1/3 committees join 316.78 us/op 349.55 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 421.59 us/op 469.52 us/op 0.90
altair processAttestation - setStatus - 2/3 committees join 535.56 us/op 569.11 us/op 0.94
altair processAttestation - setStatus - 4/5 committees join 739.54 us/op 805.91 us/op 0.92
altair processAttestation - setStatus - 100% committees join 854.84 us/op 948.02 us/op 0.90
altair processBlock - 250000 vs - 7PWei normalcase 10.793 ms/op 11.315 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 34.479 ms/op 41.397 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase 40.893 ms/op 43.401 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase hashState 95.484 ms/op 98.342 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei normalcase 3.5026 ms/op 2.7955 ms/op 1.25
phase0 processBlock - 250000 vs - 7PWei worstcase 33.705 ms/op 34.270 ms/op 0.98
altair processEth1Data - 250000 vs - 7PWei normalcase 518.80 us/op 492.33 us/op 1.05
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 16.106 us/op 9.0980 us/op 1.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 92.670 us/op 71.222 us/op 1.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 19.089 us/op 18.294 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 18.334 us/op 16.319 us/op 1.12
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 222.75 us/op 207.12 us/op 1.08
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2895 ms/op 1.4845 ms/op 1.54
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8187 ms/op 1.7447 ms/op 1.62
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8505 ms/op 2.0067 ms/op 1.42
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.3094 ms/op 4.0523 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1887 ms/op 2.3065 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.0650 ms/op 5.2372 ms/op 0.97
Tree 40 250000 create 337.98 ms/op 372.51 ms/op 0.91
Tree 40 250000 get(125000) 185.68 ns/op 196.42 ns/op 0.95
Tree 40 250000 set(125000) 950.12 ns/op 1.0841 us/op 0.88
Tree 40 250000 toArray() 17.928 ms/op 20.782 ms/op 0.86
Tree 40 250000 iterate all - toArray() + loop 18.116 ms/op 21.573 ms/op 0.84
Tree 40 250000 iterate all - get(i) 63.333 ms/op 71.699 ms/op 0.88
MutableVector 250000 create 20.512 ms/op 14.095 ms/op 1.46
MutableVector 250000 get(125000) 6.4680 ns/op 6.8750 ns/op 0.94
MutableVector 250000 set(125000) 255.90 ns/op 311.61 ns/op 0.82
MutableVector 250000 toArray() 3.1319 ms/op 4.1934 ms/op 0.75
MutableVector 250000 iterate all - toArray() + loop 3.3114 ms/op 5.4136 ms/op 0.61
MutableVector 250000 iterate all - get(i) 1.5219 ms/op 1.6572 ms/op 0.92
Array 250000 create 2.8385 ms/op 3.9232 ms/op 0.72
Array 250000 clone - spread 1.2305 ms/op 1.2746 ms/op 0.97
Array 250000 get(125000) 1.0240 ns/op 1.0990 ns/op 0.93
Array 250000 set(125000) 4.0400 ns/op 4.5530 ns/op 0.89
Array 250000 iterate all - loop 162.11 us/op 181.89 us/op 0.89
effectiveBalanceIncrements clone Uint8Array 300000 29.434 us/op 42.628 us/op 0.69
effectiveBalanceIncrements clone MutableVector 300000 367.00 ns/op 370.00 ns/op 0.99
effectiveBalanceIncrements rw all Uint8Array 300000 197.47 us/op 218.29 us/op 0.90
effectiveBalanceIncrements rw all MutableVector 300000 82.318 ms/op 90.488 ms/op 0.91
phase0 afterProcessEpoch - 250000 vs - 7PWei 110.73 ms/op 120.17 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 52.788 ms/op 58.019 ms/op 0.91
altair processEpoch - mainnet_e81889 568.24 ms/op 559.15 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 85.364 ms/op 86.721 ms/op 0.98
mainnet_e81889 - altair processJustificationAndFinalization 20.777 us/op 15.066 us/op 1.38
mainnet_e81889 - altair processInactivityUpdates 6.2352 ms/op 6.2190 ms/op 1.00
mainnet_e81889 - altair processRewardsAndPenalties 81.437 ms/op 63.309 ms/op 1.29
mainnet_e81889 - altair processRegistryUpdates 3.6970 us/op 2.6180 us/op 1.41
mainnet_e81889 - altair processSlashings 669.00 ns/op 455.00 ns/op 1.47
mainnet_e81889 - altair processEth1DataReset 824.00 ns/op 404.00 ns/op 2.04
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.6552 ms/op 2.2202 ms/op 1.20
mainnet_e81889 - altair processSlashingsReset 6.3980 us/op 4.1400 us/op 1.55
mainnet_e81889 - altair processRandaoMixesReset 6.7190 us/op 5.4950 us/op 1.22
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3930 us/op 844.00 ns/op 1.65
mainnet_e81889 - altair processParticipationFlagUpdates 2.3980 us/op 2.4900 us/op 0.96
mainnet_e81889 - altair processSyncCommitteeUpdates 760.00 ns/op 640.00 ns/op 1.19
mainnet_e81889 - altair afterProcessEpoch 117.30 ms/op 121.13 ms/op 0.97
capella processEpoch - mainnet_e217614 2.2608 s/op 2.0513 s/op 1.10
mainnet_e217614 - capella beforeProcessEpoch 512.16 ms/op 478.60 ms/op 1.07
mainnet_e217614 - capella processJustificationAndFinalization 24.761 us/op 15.185 us/op 1.63
mainnet_e217614 - capella processInactivityUpdates 20.976 ms/op 20.091 ms/op 1.04
mainnet_e217614 - capella processRewardsAndPenalties 428.44 ms/op 421.19 ms/op 1.02
mainnet_e217614 - capella processRegistryUpdates 33.415 us/op 17.044 us/op 1.96
mainnet_e217614 - capella processSlashings 667.00 ns/op 550.00 ns/op 1.21
mainnet_e217614 - capella processEth1DataReset 873.00 ns/op 401.00 ns/op 2.18
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.0184 ms/op 4.3280 ms/op 1.16
mainnet_e217614 - capella processSlashingsReset 3.7980 us/op 3.6210 us/op 1.05
mainnet_e217614 - capella processRandaoMixesReset 6.2910 us/op 4.8310 us/op 1.30
mainnet_e217614 - capella processHistoricalRootsUpdate 1.2110 us/op 548.00 ns/op 2.21
mainnet_e217614 - capella processParticipationFlagUpdates 2.1180 us/op 3.1260 us/op 0.68
mainnet_e217614 - capella afterProcessEpoch 328.94 ms/op 322.02 ms/op 1.02
phase0 processEpoch - mainnet_e58758 449.15 ms/op 482.35 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 157.27 ms/op 147.05 ms/op 1.07
mainnet_e58758 - phase0 processJustificationAndFinalization 25.108 us/op 15.079 us/op 1.67
mainnet_e58758 - phase0 processRewardsAndPenalties 64.904 ms/op 52.405 ms/op 1.24
mainnet_e58758 - phase0 processRegistryUpdates 14.533 us/op 11.347 us/op 1.28
mainnet_e58758 - phase0 processSlashings 875.00 ns/op 697.00 ns/op 1.26
mainnet_e58758 - phase0 processEth1DataReset 564.00 ns/op 415.00 ns/op 1.36
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.2194 ms/op 1.1317 ms/op 1.96
mainnet_e58758 - phase0 processSlashingsReset 3.9410 us/op 2.8780 us/op 1.37
mainnet_e58758 - phase0 processRandaoMixesReset 6.8790 us/op 3.8300 us/op 1.80
mainnet_e58758 - phase0 processHistoricalRootsUpdate 698.00 ns/op 405.00 ns/op 1.72
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.4280 us/op 3.8460 us/op 1.41
mainnet_e58758 - phase0 afterProcessEpoch 99.978 ms/op 94.228 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4392 ms/op 1.3409 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4625 ms/op 1.4778 ms/op 0.99
altair processInactivityUpdates - 250000 normalcase 36.705 ms/op 26.091 ms/op 1.41
altair processInactivityUpdates - 250000 worstcase 34.561 ms/op 27.273 ms/op 1.27
phase0 processRegistryUpdates - 250000 normalcase 14.044 us/op 7.7200 us/op 1.82
phase0 processRegistryUpdates - 250000 badcase_full_deposits 580.60 us/op 326.22 us/op 1.78
phase0 processRegistryUpdates - 250000 worstcase 0.5 139.35 ms/op 141.23 ms/op 0.99
altair processRewardsAndPenalties - 250000 normalcase 70.985 ms/op 57.789 ms/op 1.23
altair processRewardsAndPenalties - 250000 worstcase 65.788 ms/op 59.427 ms/op 1.11
phase0 getAttestationDeltas - 250000 normalcase 9.4039 ms/op 8.8881 ms/op 1.06
phase0 getAttestationDeltas - 250000 worstcase 9.0347 ms/op 8.8144 ms/op 1.02
phase0 processSlashings - 250000 worstcase 118.97 us/op 90.396 us/op 1.32
altair processSyncCommitteeUpdates - 250000 155.58 ms/op 153.42 ms/op 1.01
BeaconState.hashTreeRoot - No change 263.00 ns/op 267.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 158.74 us/op 154.49 us/op 1.03
BeaconState.hashTreeRoot - 32 full validator 1.7914 ms/op 1.5611 ms/op 1.15
BeaconState.hashTreeRoot - 512 full validator 14.456 ms/op 17.129 ms/op 0.84
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 153.37 us/op 161.77 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0969 ms/op 2.0941 ms/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 25.127 ms/op 28.368 ms/op 0.89
BeaconState.hashTreeRoot - 1 balances 121.50 us/op 142.38 us/op 0.85
BeaconState.hashTreeRoot - 32 balances 1.2725 ms/op 1.2334 ms/op 1.03
BeaconState.hashTreeRoot - 512 balances 16.525 ms/op 11.614 ms/op 1.42
BeaconState.hashTreeRoot - 250000 balances 232.14 ms/op 203.83 ms/op 1.14
aggregationBits - 2048 els - zipIndexesInBitList 17.910 us/op 17.618 us/op 1.02
byteArrayEquals 32 75.362 ns/op 74.618 ns/op 1.01
Buffer.compare 32 55.529 ns/op 56.747 ns/op 0.98
byteArrayEquals 1024 2.0609 us/op 2.0440 us/op 1.01
Buffer.compare 1024 71.311 ns/op 72.372 ns/op 0.99
byteArrayEquals 16384 32.609 us/op 32.624 us/op 1.00
Buffer.compare 16384 276.85 ns/op 257.57 ns/op 1.07
byteArrayEquals 123687377 248.95 ms/op 245.26 ms/op 1.02
Buffer.compare 123687377 7.2805 ms/op 6.3192 ms/op 1.15
byteArrayEquals 32 - diff last byte 73.635 ns/op 72.670 ns/op 1.01
Buffer.compare 32 - diff last byte 58.297 ns/op 57.926 ns/op 1.01
byteArrayEquals 1024 - diff last byte 2.0892 us/op 2.0611 us/op 1.01
Buffer.compare 1024 - diff last byte 74.033 ns/op 73.219 ns/op 1.01
byteArrayEquals 16384 - diff last byte 33.293 us/op 32.847 us/op 1.01
Buffer.compare 16384 - diff last byte 280.55 ns/op 277.02 ns/op 1.01
byteArrayEquals 123687377 - diff last byte 250.18 ms/op 242.93 ms/op 1.03
Buffer.compare 123687377 - diff last byte 7.2035 ms/op 7.2867 ms/op 0.99
byteArrayEquals 32 - random bytes 6.0900 ns/op 5.4400 ns/op 1.12
Buffer.compare 32 - random bytes 63.228 ns/op 61.650 ns/op 1.03
byteArrayEquals 1024 - random bytes 5.5500 ns/op 5.3280 ns/op 1.04
Buffer.compare 1024 - random bytes 62.201 ns/op 62.308 ns/op 1.00
byteArrayEquals 16384 - random bytes 5.6370 ns/op 5.8100 ns/op 0.97
Buffer.compare 16384 - random bytes 62.010 ns/op 62.427 ns/op 0.99
byteArrayEquals 123687377 - random bytes 9.4600 ns/op 9.1800 ns/op 1.03
Buffer.compare 123687377 - random bytes 65.210 ns/op 66.980 ns/op 0.97
regular array get 100000 times 45.934 us/op 46.399 us/op 0.99
wrappedArray get 100000 times 46.015 us/op 46.530 us/op 0.99
arrayWithProxy get 100000 times 15.146 ms/op 16.278 ms/op 0.93
ssz.Root.equals 55.361 ns/op 55.512 ns/op 1.00
byteArrayEquals 54.710 ns/op 54.584 ns/op 1.00
Buffer.compare 11.393 ns/op 11.400 ns/op 1.00
shuffle list - 16384 els 7.0979 ms/op 7.1539 ms/op 0.99
shuffle list - 250000 els 105.43 ms/op 105.31 ms/op 1.00
processSlot - 1 slots 18.582 us/op 17.533 us/op 1.06
processSlot - 32 slots 2.9876 ms/op 3.2423 ms/op 0.92
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.623 ms/op 58.270 ms/op 1.04
getCommitteeAssignments - req 1 vs - 250000 vc 2.5457 ms/op 2.4876 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.7772 ms/op 3.6656 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1777 ms/op 4.0413 ms/op 1.03
findModifiedValidators - 10000 modified validators 551.72 ms/op 532.41 ms/op 1.04
findModifiedValidators - 1000 modified validators 430.98 ms/op 438.87 ms/op 0.98
findModifiedValidators - 100 modified validators 410.04 ms/op 411.34 ms/op 1.00
findModifiedValidators - 10 modified validators 440.89 ms/op 431.17 ms/op 1.02
findModifiedValidators - 1 modified validators 427.11 ms/op 405.78 ms/op 1.05
findModifiedValidators - no difference 425.06 ms/op 415.25 ms/op 1.02
compare ViewDUs 4.8097 s/op 4.2749 s/op 1.13
compare each validator Uint8Array 1.9443 s/op 1.8461 s/op 1.05
compare ViewDU to Uint8Array 1.2543 s/op 1.1528 s/op 1.09
migrate state 1000000 validators, 24 modified, 0 new 813.82 ms/op 831.22 ms/op 0.98
migrate state 1000000 validators, 1700 modified, 1000 new 1.0170 s/op 1.1154 s/op 0.91
migrate state 1000000 validators, 3400 modified, 2000 new 1.3131 s/op 1.3534 s/op 0.97
migrate state 1500000 validators, 24 modified, 0 new 825.41 ms/op 825.28 ms/op 1.00
migrate state 1500000 validators, 1700 modified, 1000 new 1.1128 s/op 1.1185 s/op 0.99
migrate state 1500000 validators, 3400 modified, 2000 new 1.3662 s/op 1.3376 s/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2800 ns/op 4.1000 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 652.82 ns/op 690.72 ns/op 0.95
computeProposers - vc 250000 9.2545 ms/op 9.0293 ms/op 1.02
computeEpochShuffling - vc 250000 104.39 ms/op 107.21 ms/op 0.97
getNextSyncCommittee - vc 250000 158.99 ms/op 156.94 ms/op 1.01
computeSigningRoot for AttestationData 28.579 us/op 30.726 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.3574 us/op 2.2484 us/op 1.05
toHexString serialized data 1.1132 us/op 990.41 ns/op 1.12
Buffer.toString(base64) 229.51 ns/op 219.38 ns/op 1.05

by benchmarkbot/action

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

lgtm

@nazarhussain nazarhussain merged commit 4c6c33e into unstable Dec 28, 2023
13 of 14 checks passed
@nazarhussain nazarhussain deleted the nh/vitest-types branch December 28, 2023 17:33
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.14.0 🎉

ensi321 pushed a commit to ensi321/lodestar that referenced this pull request Jan 22, 2024
* Migrate type tests to vitest

* Fix the npm scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants