-
-
Notifications
You must be signed in to change notification settings - Fork 277
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 fork-choice unit tests to vitest #6216
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6216 +/- ##
============================================
- Coverage 85.63% 80.81% -4.83%
============================================
Files 172 185 +13
Lines 14372 17964 +3592
Branches 880 1082 +202
============================================
+ Hits 12308 14517 +2209
- Misses 2041 3421 +1380
- Partials 23 26 +3 |
|
Benchmark suite | Current: f7b9f3e | Previous: 2530fae | Ratio |
---|---|---|---|
getSlashingsAndExits - 2k | 1.2989 ms/op | 402.02 us/op | 3.23 |
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 16.774 us/op | 5.4010 us/op | 3.11 |
phase0 getAttestationDeltas - 250000 normalcase | 20.179 ms/op | 5.9943 ms/op | 3.37 |
Buffer.compare 123687377 - diff last byte | 20.694 ms/op | 6.4727 ms/op | 3.20 |
byteArrayEquals 123687377 - random bytes | 24.700 ns/op | 8.1300 ns/op | 3.04 |
Buffer.compare 123687377 - random bytes | 120.14 ns/op | 39.220 ns/op | 3.06 |
findModifiedValidators - no difference | 893.75 ms/op | 286.71 ms/op | 3.12 |
Full benchmark results
Benchmark suite | Current: f7b9f3e | Previous: 2530fae | Ratio |
---|---|---|---|
getPubkeys - index2pubkey - req 1000 vs - 250000 vc | 968.65 us/op | 391.97 us/op | 2.47 |
getPubkeys - validatorsArr - req 1000 vs - 250000 vc | 96.788 us/op | 56.089 us/op | 1.73 |
BLS verify - blst-native | 1.3022 ms/op | 1.1020 ms/op | 1.18 |
BLS verifyMultipleSignatures 3 - blst-native | 2.7421 ms/op | 2.2812 ms/op | 1.20 |
BLS verifyMultipleSignatures 8 - blst-native | 6.0336 ms/op | 5.0032 ms/op | 1.21 |
BLS verifyMultipleSignatures 32 - blst-native | 22.566 ms/op | 18.692 ms/op | 1.21 |
BLS verifyMultipleSignatures 64 - blst-native | 44.567 ms/op | 36.461 ms/op | 1.22 |
BLS verifyMultipleSignatures 128 - blst-native | 87.597 ms/op | 75.582 ms/op | 1.16 |
BLS deserializing 10000 signatures | 924.44 ms/op | 790.63 ms/op | 1.17 |
BLS deserializing 100000 signatures | 9.6040 s/op | 8.0558 s/op | 1.19 |
BLS verifyMultipleSignatures - same message - 3 - blst-native | 1.3561 ms/op | 1.1746 ms/op | 1.15 |
BLS verifyMultipleSignatures - same message - 8 - blst-native | 1.5399 ms/op | 1.3177 ms/op | 1.17 |
BLS verifyMultipleSignatures - same message - 32 - blst-native | 2.3616 ms/op | 2.1175 ms/op | 1.12 |
BLS verifyMultipleSignatures - same message - 64 - blst-native | 4.4134 ms/op | 3.2463 ms/op | 1.36 |
BLS verifyMultipleSignatures - same message - 128 - blst-native | 8.0436 ms/op | 6.8566 ms/op | 1.17 |
BLS aggregatePubkeys 32 - blst-native | 25.748 us/op | 23.949 us/op | 1.08 |
BLS aggregatePubkeys 128 - blst-native | 100.29 us/op | 85.627 us/op | 1.17 |
getAttestationsForBlock | 53.202 ms/op | 39.689 ms/op | 1.34 |
getSlashingsAndExits - default max | 228.74 us/op | 94.766 us/op | 2.41 |
getSlashingsAndExits - 2k | 1.2989 ms/op | 402.02 us/op | 3.23 |
proposeBlockBody type=full, size=empty | 5.2635 ms/op | 4.0703 ms/op | 1.29 |
isKnown best case - 1 super set check | 406.00 ns/op | 331.00 ns/op | 1.23 |
isKnown normal case - 2 super set checks | 543.00 ns/op | 321.00 ns/op | 1.69 |
isKnown worse case - 16 super set checks | 383.00 ns/op | 331.00 ns/op | 1.16 |
CheckpointStateCache - add get delete | 5.8540 us/op | 3.6920 us/op | 1.59 |
validate api signedAggregateAndProof - struct | 2.7948 ms/op | 2.5660 ms/op | 1.09 |
validate gossip signedAggregateAndProof - struct | 2.8050 ms/op | 2.5464 ms/op | 1.10 |
validate gossip attestation - vc 640000 | 1.3953 ms/op | 1.1868 ms/op | 1.18 |
batch validate gossip attestation - vc 640000 - chunk 32 | 177.10 us/op | 146.65 us/op | 1.21 |
batch validate gossip attestation - vc 640000 - chunk 64 | 161.52 us/op | 124.32 us/op | 1.30 |
batch validate gossip attestation - vc 640000 - chunk 128 | 156.74 us/op | 118.70 us/op | 1.32 |
batch validate gossip attestation - vc 640000 - chunk 256 | 146.18 us/op | 113.37 us/op | 1.29 |
pickEth1Vote - no votes | 1.3716 ms/op | 924.25 us/op | 1.48 |
pickEth1Vote - max votes | 9.6448 ms/op | 13.091 ms/op | 0.74 |
pickEth1Vote - Eth1Data hashTreeRoot value x2048 | 18.443 ms/op | 23.765 ms/op | 0.78 |
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 | 36.786 ms/op | 23.761 ms/op | 1.55 |
pickEth1Vote - Eth1Data fastSerialize value x2048 | 684.08 us/op | 513.03 us/op | 1.33 |
pickEth1Vote - Eth1Data fastSerialize tree x2048 | 8.6453 ms/op | 4.4490 ms/op | 1.94 |
bytes32 toHexString | 687.00 ns/op | 670.00 ns/op | 1.03 |
bytes32 Buffer.toString(hex) | 331.00 ns/op | 354.00 ns/op | 0.94 |
bytes32 Buffer.toString(hex) from Uint8Array | 579.00 ns/op | 520.00 ns/op | 1.11 |
bytes32 Buffer.toString(hex) + 0x | 318.00 ns/op | 321.00 ns/op | 0.99 |
Object access 1 prop | 0.20000 ns/op | 0.21000 ns/op | 0.95 |
Map access 1 prop | 0.16200 ns/op | 0.20100 ns/op | 0.81 |
Object get x1000 | 7.5270 ns/op | 5.8160 ns/op | 1.29 |
Map get x1000 | 0.83400 ns/op | 0.73300 ns/op | 1.14 |
Object set x1000 | 69.035 ns/op | 28.161 ns/op | 2.45 |
Map set x1000 | 51.501 ns/op | 17.542 ns/op | 2.94 |
Return object 10000 times | 0.26100 ns/op | 0.22640 ns/op | 1.15 |
Throw Error 10000 times | 3.9910 us/op | 2.7868 us/op | 1.43 |
fastMsgIdFn sha256 / 200 bytes | 3.4790 us/op | 1.9390 us/op | 1.79 |
fastMsgIdFn h32 xxhash / 200 bytes | 318.00 ns/op | 299.00 ns/op | 1.06 |
fastMsgIdFn h64 xxhash / 200 bytes | 394.00 ns/op | 344.00 ns/op | 1.15 |
fastMsgIdFn sha256 / 1000 bytes | 11.757 us/op | 6.2100 us/op | 1.89 |
fastMsgIdFn h32 xxhash / 1000 bytes | 493.00 ns/op | 405.00 ns/op | 1.22 |
fastMsgIdFn h64 xxhash / 1000 bytes | 466.00 ns/op | 405.00 ns/op | 1.15 |
fastMsgIdFn sha256 / 10000 bytes | 104.54 us/op | 52.287 us/op | 2.00 |
fastMsgIdFn h32 xxhash / 10000 bytes | 2.0070 us/op | 1.7810 us/op | 1.13 |
fastMsgIdFn h64 xxhash / 10000 bytes | 1.3440 us/op | 1.2210 us/op | 1.10 |
send data - 1000 256B messages | 21.775 ms/op | 11.508 ms/op | 1.89 |
send data - 1000 512B messages | 28.484 ms/op | 14.913 ms/op | 1.91 |
send data - 1000 1024B messages | 42.969 ms/op | 23.158 ms/op | 1.86 |
send data - 1000 1200B messages | 41.467 ms/op | 28.532 ms/op | 1.45 |
send data - 1000 2048B messages | 46.955 ms/op | 36.292 ms/op | 1.29 |
send data - 1000 4096B messages | 46.590 ms/op | 31.335 ms/op | 1.49 |
send data - 1000 16384B messages | 126.38 ms/op | 92.439 ms/op | 1.37 |
send data - 1000 65536B messages | 485.52 ms/op | 422.93 ms/op | 1.15 |
enrSubnets - fastDeserialize 64 bits | 1.9930 us/op | 976.00 ns/op | 2.04 |
enrSubnets - ssz BitVector 64 bits | 666.00 ns/op | 411.00 ns/op | 1.62 |
enrSubnets - fastDeserialize 4 bits | 250.00 ns/op | 201.00 ns/op | 1.24 |
enrSubnets - ssz BitVector 4 bits | 599.00 ns/op | 416.00 ns/op | 1.44 |
prioritizePeers score -10:0 att 32-0.1 sync 2-0 | 126.85 us/op | 69.770 us/op | 1.82 |
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 | 157.09 us/op | 77.468 us/op | 2.03 |
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 | 211.88 us/op | 102.49 us/op | 2.07 |
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 | 380.63 us/op | 179.67 us/op | 2.12 |
prioritizePeers score 0:0 att 64-1 sync 4-1 | 390.13 us/op | 203.80 us/op | 1.91 |
array of 16000 items push then shift | 1.8403 us/op | 1.2761 us/op | 1.44 |
LinkedList of 16000 items push then shift | 10.300 ns/op | 5.9540 ns/op | 1.73 |
array of 16000 items push then pop | 123.83 ns/op | 57.390 ns/op | 2.16 |
LinkedList of 16000 items push then pop | 9.1670 ns/op | 5.6330 ns/op | 1.63 |
array of 24000 items push then shift | 2.7045 us/op | 1.8935 us/op | 1.43 |
LinkedList of 24000 items push then shift | 9.6640 ns/op | 5.7590 ns/op | 1.68 |
array of 24000 items push then pop | 169.22 ns/op | 76.674 ns/op | 2.21 |
LinkedList of 24000 items push then pop | 9.9050 ns/op | 5.6860 ns/op | 1.74 |
intersect bitArray bitLen 8 | 7.1110 ns/op | 5.0550 ns/op | 1.41 |
intersect array and set length 8 | 117.01 ns/op | 49.177 ns/op | 2.38 |
intersect bitArray bitLen 128 | 39.359 ns/op | 27.571 ns/op | 1.43 |
intersect array and set length 128 | 1.0816 us/op | 686.06 ns/op | 1.58 |
bitArray.getTrueBitIndexes() bitLen 128 | 2.0530 us/op | 1.1500 us/op | 1.79 |
bitArray.getTrueBitIndexes() bitLen 248 | 2.9690 us/op | 1.8300 us/op | 1.62 |
bitArray.getTrueBitIndexes() bitLen 512 | 6.1240 us/op | 3.4360 us/op | 1.78 |
Buffer.concat 32 items | 1.0720 us/op | 838.00 ns/op | 1.28 |
Uint8Array.set 32 items | 2.1330 us/op | 1.5860 us/op | 1.34 |
Set add up to 64 items then delete first | 4.9478 us/op | 1.7346 us/op | 2.85 |
OrderedSet add up to 64 items then delete first | 6.4332 us/op | 2.6479 us/op | 2.43 |
Set add up to 64 items then delete last | 5.3463 us/op | 1.9891 us/op | 2.69 |
OrderedSet add up to 64 items then delete last | 7.3747 us/op | 2.9662 us/op | 2.49 |
Set add up to 64 items then delete middle | 5.5082 us/op | 1.9838 us/op | 2.78 |
OrderedSet add up to 64 items then delete middle | 9.1109 us/op | 4.1603 us/op | 2.19 |
Set add up to 128 items then delete first | 10.600 us/op | 3.9154 us/op | 2.71 |
OrderedSet add up to 128 items then delete first | 14.180 us/op | 6.1481 us/op | 2.31 |
Set add up to 128 items then delete last | 9.8745 us/op | 3.7722 us/op | 2.62 |
OrderedSet add up to 128 items then delete last | 14.501 us/op | 5.7034 us/op | 2.54 |
Set add up to 128 items then delete middle | 9.8325 us/op | 3.7910 us/op | 2.59 |
OrderedSet add up to 128 items then delete middle | 19.599 us/op | 10.672 us/op | 1.84 |
Set add up to 256 items then delete first | 21.582 us/op | 7.6162 us/op | 2.83 |
OrderedSet add up to 256 items then delete first | 27.150 us/op | 12.176 us/op | 2.23 |
Set add up to 256 items then delete last | 20.457 us/op | 7.4153 us/op | 2.76 |
OrderedSet add up to 256 items then delete last | 28.772 us/op | 11.342 us/op | 2.54 |
Set add up to 256 items then delete middle | 19.184 us/op | 7.3950 us/op | 2.59 |
OrderedSet add up to 256 items then delete middle | 51.918 us/op | 30.140 us/op | 1.72 |
transfer serialized Status (84 B) | 2.0430 us/op | 1.3580 us/op | 1.50 |
copy serialized Status (84 B) | 1.7800 us/op | 1.1650 us/op | 1.53 |
transfer serialized SignedVoluntaryExit (112 B) | 2.0370 us/op | 1.3710 us/op | 1.49 |
copy serialized SignedVoluntaryExit (112 B) | 1.7510 us/op | 1.1720 us/op | 1.49 |
transfer serialized ProposerSlashing (416 B) | 2.3500 us/op | 1.5180 us/op | 1.55 |
copy serialized ProposerSlashing (416 B) | 2.7180 us/op | 1.3720 us/op | 1.98 |
transfer serialized Attestation (485 B) | 2.3440 us/op | 1.5680 us/op | 1.49 |
copy serialized Attestation (485 B) | 2.1410 us/op | 1.3820 us/op | 1.55 |
transfer serialized AttesterSlashing (33232 B) | 2.2810 us/op | 1.6410 us/op | 1.39 |
copy serialized AttesterSlashing (33232 B) | 8.7240 us/op | 3.4760 us/op | 2.51 |
transfer serialized Small SignedBeaconBlock (128000 B) | 2.7050 us/op | 1.7240 us/op | 1.57 |
copy serialized Small SignedBeaconBlock (128000 B) | 61.087 us/op | 8.3810 us/op | 7.29 |
transfer serialized Avg SignedBeaconBlock (200000 B) | 3.7220 us/op | 1.9190 us/op | 1.94 |
copy serialized Avg SignedBeaconBlock (200000 B) | 47.996 us/op | 12.711 us/op | 3.78 |
transfer serialized BlobsSidecar (524380 B) | 4.3610 us/op | 2.2330 us/op | 1.95 |
copy serialized BlobsSidecar (524380 B) | 134.68 us/op | 78.101 us/op | 1.72 |
transfer serialized Big SignedBeaconBlock (1000000 B) | 3.7140 us/op | 2.6970 us/op | 1.38 |
copy serialized Big SignedBeaconBlock (1000000 B) | 182.78 us/op | 195.67 us/op | 0.93 |
pass gossip attestations to forkchoice per slot | 4.3563 ms/op | 2.7362 ms/op | 1.59 |
forkChoice updateHead vc 100000 bc 64 eq 0 | 855.08 us/op | 491.32 us/op | 1.74 |
forkChoice updateHead vc 600000 bc 64 eq 0 | 4.9594 ms/op | 2.7156 ms/op | 1.83 |
forkChoice updateHead vc 1000000 bc 64 eq 0 | 8.6359 ms/op | 4.4277 ms/op | 1.95 |
forkChoice updateHead vc 600000 bc 320 eq 0 | 5.0336 ms/op | 2.6223 ms/op | 1.92 |
forkChoice updateHead vc 600000 bc 1200 eq 0 | 5.2408 ms/op | 2.6921 ms/op | 1.95 |
forkChoice updateHead vc 600000 bc 7200 eq 0 | 5.8502 ms/op | 3.5379 ms/op | 1.65 |
forkChoice updateHead vc 600000 bc 64 eq 1000 | 11.829 ms/op | 10.063 ms/op | 1.18 |
forkChoice updateHead vc 600000 bc 64 eq 10000 | 13.389 ms/op | 9.7239 ms/op | 1.38 |
forkChoice updateHead vc 600000 bc 64 eq 300000 | 19.157 ms/op | 11.895 ms/op | 1.61 |
computeDeltas 500000 validators 300 proto nodes | 7.1001 ms/op | 3.0617 ms/op | 2.32 |
computeDeltas 500000 validators 1200 proto nodes | 7.3988 ms/op | 2.9465 ms/op | 2.51 |
computeDeltas 500000 validators 7200 proto nodes | 6.9383 ms/op | 3.0148 ms/op | 2.30 |
computeDeltas 750000 validators 300 proto nodes | 11.041 ms/op | 4.7349 ms/op | 2.33 |
computeDeltas 750000 validators 1200 proto nodes | 11.679 ms/op | 4.7388 ms/op | 2.46 |
computeDeltas 750000 validators 7200 proto nodes | 10.801 ms/op | 4.5791 ms/op | 2.36 |
computeDeltas 1400000 validators 300 proto nodes | 20.728 ms/op | 9.4619 ms/op | 2.19 |
computeDeltas 1400000 validators 1200 proto nodes | 21.255 ms/op | 8.9484 ms/op | 2.38 |
computeDeltas 1400000 validators 7200 proto nodes | 20.829 ms/op | 9.1763 ms/op | 2.27 |
computeDeltas 2100000 validators 300 proto nodes | 30.243 ms/op | 13.958 ms/op | 2.17 |
computeDeltas 2100000 validators 1200 proto nodes | 29.650 ms/op | 13.560 ms/op | 2.19 |
computeDeltas 2100000 validators 7200 proto nodes | 30.069 ms/op | 13.674 ms/op | 2.20 |
computeProposerBoostScoreFromBalances 500000 validators | 4.0891 ms/op | 3.2580 ms/op | 1.26 |
computeProposerBoostScoreFromBalances 750000 validators | 4.2928 ms/op | 3.2912 ms/op | 1.30 |
computeProposerBoostScoreFromBalances 1400000 validators | 4.4133 ms/op | 3.2024 ms/op | 1.38 |
computeProposerBoostScoreFromBalances 2100000 validators | 4.3752 ms/op | 3.2294 ms/op | 1.35 |
altair processAttestation - 250000 vs - 7PWei normalcase | 3.8218 ms/op | 1.6979 ms/op | 2.25 |
altair processAttestation - 250000 vs - 7PWei worstcase | 5.3106 ms/op | 2.8145 ms/op | 1.89 |
altair processAttestation - setStatus - 1/6 committees join | 182.04 us/op | 122.77 us/op | 1.48 |
altair processAttestation - setStatus - 1/3 committees join | 331.51 us/op | 210.54 us/op | 1.57 |
altair processAttestation - setStatus - 1/2 committees join | 426.19 us/op | 364.88 us/op | 1.17 |
altair processAttestation - setStatus - 2/3 committees join | 550.61 us/op | 404.38 us/op | 1.36 |
altair processAttestation - setStatus - 4/5 committees join | 882.53 us/op | 691.76 us/op | 1.28 |
altair processAttestation - setStatus - 100% committees join | 1.0070 ms/op | 647.73 us/op | 1.55 |
altair processBlock - 250000 vs - 7PWei normalcase | 13.756 ms/op | 12.047 ms/op | 1.14 |
altair processBlock - 250000 vs - 7PWei normalcase hashState | 47.603 ms/op | 40.059 ms/op | 1.19 |
altair processBlock - 250000 vs - 7PWei worstcase | 44.815 ms/op | 49.499 ms/op | 0.91 |
altair processBlock - 250000 vs - 7PWei worstcase hashState | 104.43 ms/op | 136.43 ms/op | 0.77 |
phase0 processBlock - 250000 vs - 7PWei normalcase | 3.1947 ms/op | 4.0689 ms/op | 0.79 |
phase0 processBlock - 250000 vs - 7PWei worstcase | 35.287 ms/op | 34.489 ms/op | 1.02 |
altair processEth1Data - 250000 vs - 7PWei normalcase | 892.86 us/op | 750.49 us/op | 1.19 |
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 16.774 us/op | 5.4010 us/op | 3.11 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 | 97.463 us/op | 52.845 us/op | 1.84 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 | 21.648 us/op | 14.676 us/op | 1.48 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 | 9.1480 us/op | 9.1200 us/op | 1.00 |
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 | 219.76 us/op | 154.45 us/op | 1.42 |
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 | 1.3784 ms/op | 1.5432 ms/op | 0.89 |
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 | 1.9212 ms/op | 1.0401 ms/op | 1.85 |
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 | 1.8109 ms/op | 1.4502 ms/op | 1.25 |
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 | 3.9575 ms/op | 2.2438 ms/op | 1.76 |
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 | 2.7113 ms/op | 1.7352 ms/op | 1.56 |
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 | 5.6719 ms/op | 3.3702 ms/op | 1.68 |
Tree 40 250000 create | 379.57 ms/op | 272.28 ms/op | 1.39 |
Tree 40 250000 get(125000) | 211.71 ns/op | 105.15 ns/op | 2.01 |
Tree 40 250000 set(125000) | 1.0779 us/op | 732.16 ns/op | 1.47 |
Tree 40 250000 toArray() | 23.191 ms/op | 14.880 ms/op | 1.56 |
Tree 40 250000 iterate all - toArray() + loop | 23.198 ms/op | 14.651 ms/op | 1.58 |
Tree 40 250000 iterate all - get(i) | 73.488 ms/op | 40.548 ms/op | 1.81 |
MutableVector 250000 create | 17.670 ms/op | 11.686 ms/op | 1.51 |
MutableVector 250000 get(125000) | 6.9330 ns/op | 5.3550 ns/op | 1.29 |
MutableVector 250000 set(125000) | 356.56 ns/op | 196.76 ns/op | 1.81 |
MutableVector 250000 toArray() | 4.3560 ms/op | 2.5651 ms/op | 1.70 |
MutableVector 250000 iterate all - toArray() + loop | 4.8943 ms/op | 2.7324 ms/op | 1.79 |
MutableVector 250000 iterate all - get(i) | 1.5993 ms/op | 1.3298 ms/op | 1.20 |
Array 250000 create | 4.8148 ms/op | 2.3689 ms/op | 2.03 |
Array 250000 clone - spread | 1.3191 ms/op | 9.1842 ms/op | 0.14 |
Array 250000 get(125000) | 1.1620 ns/op | 1.0410 ns/op | 1.12 |
Array 250000 set(125000) | 4.3860 ns/op | 1.1490 ns/op | 3.82 |
Array 250000 iterate all - loop | 222.66 us/op | 147.23 us/op | 1.51 |
effectiveBalanceIncrements clone Uint8Array 300000 | 86.535 us/op | 18.699 us/op | 4.63 |
effectiveBalanceIncrements clone MutableVector 300000 | 375.00 ns/op | 352.00 ns/op | 1.07 |
effectiveBalanceIncrements rw all Uint8Array 300000 | 222.34 us/op | 176.45 us/op | 1.26 |
effectiveBalanceIncrements rw all MutableVector 300000 | 98.089 ms/op | 61.459 ms/op | 1.60 |
phase0 afterProcessEpoch - 250000 vs - 7PWei | 116.51 ms/op | 77.303 ms/op | 1.51 |
phase0 beforeProcessEpoch - 250000 vs - 7PWei | 61.852 ms/op | 44.584 ms/op | 1.39 |
altair processEpoch - mainnet_e81889 | 666.79 ms/op | 428.32 ms/op | 1.56 |
mainnet_e81889 - altair beforeProcessEpoch | 107.48 ms/op | 74.221 ms/op | 1.45 |
mainnet_e81889 - altair processJustificationAndFinalization | 27.501 us/op | 10.411 us/op | 2.64 |
mainnet_e81889 - altair processInactivityUpdates | 9.4958 ms/op | 5.9123 ms/op | 1.61 |
mainnet_e81889 - altair processRewardsAndPenalties | 60.193 ms/op | 58.935 ms/op | 1.02 |
mainnet_e81889 - altair processRegistryUpdates | 5.7790 us/op | 2.5700 us/op | 2.25 |
mainnet_e81889 - altair processSlashings | 1.2160 us/op | 601.00 ns/op | 2.02 |
mainnet_e81889 - altair processEth1DataReset | 1.1200 us/op | 571.00 ns/op | 1.96 |
mainnet_e81889 - altair processEffectiveBalanceUpdates | 2.2219 ms/op | 1.7600 ms/op | 1.26 |
mainnet_e81889 - altair processSlashingsReset | 7.7240 us/op | 2.4930 us/op | 3.10 |
mainnet_e81889 - altair processRandaoMixesReset | 7.6690 us/op | 2.8330 us/op | 2.71 |
mainnet_e81889 - altair processHistoricalRootsUpdate | 1.9310 us/op | 649.00 ns/op | 2.98 |
mainnet_e81889 - altair processParticipationFlagUpdates | 5.7620 us/op | 1.4530 us/op | 3.97 |
mainnet_e81889 - altair processSyncCommitteeUpdates | 1.9050 us/op | 532.00 ns/op | 3.58 |
mainnet_e81889 - altair afterProcessEpoch | 138.81 ms/op | 80.565 ms/op | 1.72 |
capella processEpoch - mainnet_e217614 | 3.1240 s/op | 2.2132 s/op | 1.41 |
mainnet_e217614 - capella beforeProcessEpoch | 710.63 ms/op | 429.03 ms/op | 1.66 |
mainnet_e217614 - capella processJustificationAndFinalization | 29.727 us/op | 11.791 us/op | 2.52 |
mainnet_e217614 - capella processInactivityUpdates | 27.943 ms/op | 19.446 ms/op | 1.44 |
mainnet_e217614 - capella processRewardsAndPenalties | 601.83 ms/op | 383.38 ms/op | 1.57 |
mainnet_e217614 - capella processRegistryUpdates | 46.527 us/op | 13.682 us/op | 3.40 |
mainnet_e217614 - capella processSlashings | 1.5760 us/op | 591.00 ns/op | 2.67 |
mainnet_e217614 - capella processEth1DataReset | 1.4700 us/op | 628.00 ns/op | 2.34 |
mainnet_e217614 - capella processEffectiveBalanceUpdates | 9.6958 ms/op | 3.4986 ms/op | 2.77 |
mainnet_e217614 - capella processSlashingsReset | 11.521 us/op | 3.0990 us/op | 3.72 |
mainnet_e217614 - capella processRandaoMixesReset | 13.078 us/op | 8.2410 us/op | 1.59 |
mainnet_e217614 - capella processHistoricalRootsUpdate | 1.5010 us/op | 793.00 ns/op | 1.89 |
mainnet_e217614 - capella processParticipationFlagUpdates | 6.4320 us/op | 1.3540 us/op | 4.75 |
mainnet_e217614 - capella afterProcessEpoch | 390.77 ms/op | 227.97 ms/op | 1.71 |
phase0 processEpoch - mainnet_e58758 | 803.29 ms/op | 415.10 ms/op | 1.94 |
mainnet_e58758 - phase0 beforeProcessEpoch | 257.78 ms/op | 142.03 ms/op | 1.82 |
mainnet_e58758 - phase0 processJustificationAndFinalization | 37.224 us/op | 16.703 us/op | 2.23 |
mainnet_e58758 - phase0 processRewardsAndPenalties | 80.824 ms/op | 47.537 ms/op | 1.70 |
mainnet_e58758 - phase0 processRegistryUpdates | 25.651 us/op | 9.0180 us/op | 2.84 |
mainnet_e58758 - phase0 processSlashings | 1.4840 us/op | 978.00 ns/op | 1.52 |
mainnet_e58758 - phase0 processEth1DataReset | 1.5140 us/op | 640.00 ns/op | 2.37 |
mainnet_e58758 - phase0 processEffectiveBalanceUpdates | 2.6853 ms/op | 969.53 us/op | 2.77 |
mainnet_e58758 - phase0 processSlashingsReset | 8.8170 us/op | 4.1260 us/op | 2.14 |
mainnet_e58758 - phase0 processRandaoMixesReset | 12.166 us/op | 4.2310 us/op | 2.88 |
mainnet_e58758 - phase0 processHistoricalRootsUpdate | 1.4340 us/op | 997.00 ns/op | 1.44 |
mainnet_e58758 - phase0 processParticipationRecordUpdates | 11.879 us/op | 5.0010 us/op | 2.38 |
mainnet_e58758 - phase0 afterProcessEpoch | 119.88 ms/op | 68.392 ms/op | 1.75 |
phase0 processEffectiveBalanceUpdates - 250000 normalcase | 3.0898 ms/op | 1.2471 ms/op | 2.48 |
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 | 3.3194 ms/op | 1.2880 ms/op | 2.58 |
altair processInactivityUpdates - 250000 normalcase | 53.575 ms/op | 30.384 ms/op | 1.76 |
altair processInactivityUpdates - 250000 worstcase | 53.706 ms/op | 26.847 ms/op | 2.00 |
phase0 processRegistryUpdates - 250000 normalcase | 26.202 us/op | 11.336 us/op | 2.31 |
phase0 processRegistryUpdates - 250000 badcase_full_deposits | 699.14 us/op | 391.91 us/op | 1.78 |
phase0 processRegistryUpdates - 250000 worstcase 0.5 | 268.88 ms/op | 114.00 ms/op | 2.36 |
altair processRewardsAndPenalties - 250000 normalcase | 83.978 ms/op | 41.015 ms/op | 2.05 |
altair processRewardsAndPenalties - 250000 worstcase | 91.677 ms/op | 54.871 ms/op | 1.67 |
phase0 getAttestationDeltas - 250000 normalcase | 20.179 ms/op | 5.9943 ms/op | 3.37 |
phase0 getAttestationDeltas - 250000 worstcase | 17.516 ms/op | 8.3034 ms/op | 2.11 |
phase0 processSlashings - 250000 worstcase | 163.89 us/op | 84.615 us/op | 1.94 |
altair processSyncCommitteeUpdates - 250000 | 209.02 ms/op | 127.03 ms/op | 1.65 |
BeaconState.hashTreeRoot - No change | 637.00 ns/op | 447.00 ns/op | 1.43 |
BeaconState.hashTreeRoot - 1 full validator | 302.35 us/op | 130.44 us/op | 2.32 |
BeaconState.hashTreeRoot - 32 full validator | 3.1509 ms/op | 1.4590 ms/op | 2.16 |
BeaconState.hashTreeRoot - 512 full validator | 27.618 ms/op | 18.472 ms/op | 1.50 |
BeaconState.hashTreeRoot - 1 validator.effectiveBalance | 526.42 us/op | 150.25 us/op | 3.50 |
BeaconState.hashTreeRoot - 32 validator.effectiveBalance | 4.9499 ms/op | 2.0279 ms/op | 2.44 |
BeaconState.hashTreeRoot - 512 validator.effectiveBalance | 56.209 ms/op | 32.852 ms/op | 1.71 |
BeaconState.hashTreeRoot - 1 balances | 228.41 us/op | 118.80 us/op | 1.92 |
BeaconState.hashTreeRoot - 32 balances | 2.0262 ms/op | 1.1455 ms/op | 1.77 |
BeaconState.hashTreeRoot - 512 balances | 21.993 ms/op | 10.696 ms/op | 2.06 |
BeaconState.hashTreeRoot - 250000 balances | 350.11 ms/op | 192.93 ms/op | 1.81 |
aggregationBits - 2048 els - zipIndexesInBitList | 51.049 us/op | 10.749 us/op | 4.75 |
byteArrayEquals 32 | 115.73 ns/op | 65.390 ns/op | 1.77 |
Buffer.compare 32 | 86.228 ns/op | 39.177 ns/op | 2.20 |
byteArrayEquals 1024 | 2.9891 us/op | 1.7661 us/op | 1.69 |
Buffer.compare 1024 | 87.712 ns/op | 47.677 ns/op | 1.84 |
byteArrayEquals 16384 | 52.649 us/op | 28.330 us/op | 1.86 |
Buffer.compare 16384 | 441.59 ns/op | 223.57 ns/op | 1.98 |
byteArrayEquals 123687377 | 327.13 ms/op | 206.09 ms/op | 1.59 |
Buffer.compare 123687377 | 16.398 ms/op | 7.7511 ms/op | 2.12 |
byteArrayEquals 32 - diff last byte | 99.487 ns/op | 65.340 ns/op | 1.52 |
Buffer.compare 32 - diff last byte | 66.324 ns/op | 42.034 ns/op | 1.58 |
byteArrayEquals 1024 - diff last byte | 3.2883 us/op | 1.9043 us/op | 1.73 |
Buffer.compare 1024 - diff last byte | 93.193 ns/op | 48.633 ns/op | 1.92 |
byteArrayEquals 16384 - diff last byte | 53.043 us/op | 27.886 us/op | 1.90 |
Buffer.compare 16384 - diff last byte | 379.12 ns/op | 241.23 ns/op | 1.57 |
byteArrayEquals 123687377 - diff last byte | 378.75 ms/op | 213.52 ms/op | 1.77 |
Buffer.compare 123687377 - diff last byte | 20.694 ms/op | 6.4727 ms/op | 3.20 |
byteArrayEquals 32 - random bytes | 10.061 ns/op | 5.3600 ns/op | 1.88 |
Buffer.compare 32 - random bytes | 82.524 ns/op | 39.720 ns/op | 2.08 |
byteArrayEquals 1024 - random bytes | 9.7000 ns/op | 5.0070 ns/op | 1.94 |
Buffer.compare 1024 - random bytes | 91.091 ns/op | 37.014 ns/op | 2.46 |
byteArrayEquals 16384 - random bytes | 8.6730 ns/op | 4.9680 ns/op | 1.75 |
Buffer.compare 16384 - random bytes | 77.189 ns/op | 36.888 ns/op | 2.09 |
byteArrayEquals 123687377 - random bytes | 24.700 ns/op | 8.1300 ns/op | 3.04 |
Buffer.compare 123687377 - random bytes | 120.14 ns/op | 39.220 ns/op | 3.06 |
regular array get 100000 times | 59.671 us/op | 41.615 us/op | 1.43 |
wrappedArray get 100000 times | 80.814 us/op | 41.354 us/op | 1.95 |
arrayWithProxy get 100000 times | 20.039 ms/op | 9.2633 ms/op | 2.16 |
ssz.Root.equals | 75.686 ns/op | 55.729 ns/op | 1.36 |
byteArrayEquals | 64.426 ns/op | 53.145 ns/op | 1.21 |
Buffer.compare | 20.916 ns/op | 9.8420 ns/op | 2.13 |
shuffle list - 16384 els | 8.8453 ms/op | 4.7429 ms/op | 1.86 |
shuffle list - 250000 els | 127.10 ms/op | 71.127 ms/op | 1.79 |
processSlot - 1 slots | 31.142 us/op | 15.393 us/op | 2.02 |
processSlot - 32 slots | 4.7082 ms/op | 2.8292 ms/op | 1.66 |
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei | 76.873 ms/op | 52.256 ms/op | 1.47 |
getCommitteeAssignments - req 1 vs - 250000 vc | 2.6577 ms/op | 2.2709 ms/op | 1.17 |
getCommitteeAssignments - req 100 vs - 250000 vc | 3.9256 ms/op | 3.2926 ms/op | 1.19 |
getCommitteeAssignments - req 1000 vs - 250000 vc | 4.6765 ms/op | 3.7173 ms/op | 1.26 |
findModifiedValidators - 10000 modified validators | 732.19 ms/op | 433.44 ms/op | 1.69 |
findModifiedValidators - 1000 modified validators | 766.11 ms/op | 334.49 ms/op | 2.29 |
findModifiedValidators - 100 modified validators | 662.26 ms/op | 298.28 ms/op | 2.22 |
findModifiedValidators - 10 modified validators | 767.26 ms/op | 343.26 ms/op | 2.24 |
findModifiedValidators - 1 modified validators | 737.28 ms/op | 300.73 ms/op | 2.45 |
findModifiedValidators - no difference | 893.75 ms/op | 286.71 ms/op | 3.12 |
compare ViewDUs | 8.7745 s/op | 3.9242 s/op | 2.24 |
compare each validator Uint8Array | 3.5035 s/op | 1.9307 s/op | 1.81 |
compare ViewDU to Uint8Array | 2.1332 s/op | 786.47 ms/op | 2.71 |
migrate state 1000000 validators, 24 modified, 0 new | 1.2632 s/op | 748.66 ms/op | 1.69 |
migrate state 1000000 validators, 1700 modified, 1000 new | 1.8738 s/op | 941.61 ms/op | 1.99 |
migrate state 1000000 validators, 3400 modified, 2000 new | 2.2716 s/op | 1.1895 s/op | 1.91 |
migrate state 1500000 validators, 24 modified, 0 new | 1.5041 s/op | 711.67 ms/op | 2.11 |
migrate state 1500000 validators, 1700 modified, 1000 new | 1.9023 s/op | 931.91 ms/op | 2.04 |
migrate state 1500000 validators, 3400 modified, 2000 new | 2.0877 s/op | 1.0465 s/op | 1.99 |
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei | 5.9000 ns/op | 4.3100 ns/op | 1.37 |
state getBlockRootAtSlot - 250000 vs - 7PWei | 806.10 ns/op | 405.66 ns/op | 1.99 |
computeProposers - vc 250000 | 10.451 ms/op | 6.1354 ms/op | 1.70 |
computeEpochShuffling - vc 250000 | 126.74 ms/op | 70.765 ms/op | 1.79 |
getNextSyncCommittee - vc 250000 | 190.05 ms/op | 113.51 ms/op | 1.67 |
computeSigningRoot for AttestationData | 34.543 us/op | 26.077 us/op | 1.32 |
hash AttestationData serialized data then Buffer.toString(base64) | 2.5868 us/op | 1.2731 us/op | 2.03 |
toHexString serialized data | 1.8331 us/op | 794.82 ns/op | 2.31 |
Buffer.toString(base64) | 312.32 ns/op | 152.03 ns/op | 2.05 |
by benchmarkbot/action
nflaig
reviewed
Dec 21, 2023
packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts
Outdated
Show resolved
Hide resolved
nflaig
reviewed
Dec 21, 2023
packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
nflaig
approved these changes
Dec 21, 2023
🎉 This PR is included in v1.14.0 🎉 |
ensi321
pushed a commit
to ensi321/lodestar
that referenced
this pull request
Jan 22, 2024
* Migrate fork-choice unit tests to vitest * Fix the assertion messages * Update packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts Co-authored-by: Nico Flaig <nflaig@protonmail.com> * Fix assertion message --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Consolidate the testing frameworks and migrate to vitest.
Description
Migrate
fork-choice
unit tests to vitest.Closes #issue_number