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: track prepare next epoch time #6256

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jan 8, 2024

Motivation

Track prepare next epoch time at lodestar side, the log shows that a lot of time it take >4s on holesky

Description

  • This is to track how much time does it take at lodestar side to run epoch transition + hashTreeRoot()
  • There are also time to call execution engine, but I only want to focus on lodestar side in order to improve performance

@twoeths twoeths requested a review from a team as a code owner January 8, 2024 07:04
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Merging #6256 (624588c) into unstable (b3e5621) will increase coverage by 0.07%.
Report is 3 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6256      +/-   ##
============================================
+ Coverage     80.31%   80.38%   +0.07%     
============================================
  Files           202      202              
  Lines         19543    19622      +79     
  Branches       1169     1176       +7     
============================================
+ Hits          15695    15773      +78     
- Misses         3820     3821       +1     
  Partials         28       28              

Copy link
Contributor

github-actions bot commented Jan 8, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f6ddf6d Previous: fce884d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 656.99 us/op 736.61 us/op 0.89
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 147.52 us/op 97.246 us/op 1.52
BLS verify - blst-native 1.3994 ms/op 1.1105 ms/op 1.26
BLS verifyMultipleSignatures 3 - blst-native 2.8461 ms/op 2.4096 ms/op 1.18
BLS verifyMultipleSignatures 8 - blst-native 6.1603 ms/op 5.1943 ms/op 1.19
BLS verifyMultipleSignatures 32 - blst-native 22.677 ms/op 19.350 ms/op 1.17
BLS verifyMultipleSignatures 64 - blst-native 45.666 ms/op 39.289 ms/op 1.16
BLS verifyMultipleSignatures 128 - blst-native 88.394 ms/op 75.413 ms/op 1.17
BLS deserializing 10000 signatures 965.94 ms/op 817.29 ms/op 1.18
BLS deserializing 100000 signatures 9.2547 s/op 8.7200 s/op 1.06
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3886 ms/op 1.1691 ms/op 1.19
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5624 ms/op 1.5652 ms/op 1.00
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4253 ms/op 2.2325 ms/op 1.09
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5810 ms/op 4.1549 ms/op 0.86
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.9493 ms/op 5.1083 ms/op 1.16
BLS aggregatePubkeys 32 - blst-native 26.838 us/op 23.147 us/op 1.16
BLS aggregatePubkeys 128 - blst-native 102.67 us/op 91.189 us/op 1.13
getAttestationsForBlock 59.246 ms/op 39.468 ms/op 1.50
getSlashingsAndExits - default max 159.83 us/op 131.73 us/op 1.21
getSlashingsAndExits - 2k 660.43 us/op 507.25 us/op 1.30
proposeBlockBody type=full, size=empty 6.9998 ms/op 5.4281 ms/op 1.29
isKnown best case - 1 super set check 640.00 ns/op 391.00 ns/op 1.64
isKnown normal case - 2 super set checks 726.00 ns/op 346.00 ns/op 2.10
isKnown worse case - 16 super set checks 784.00 ns/op 399.00 ns/op 1.96
CheckpointStateCache - add get delete 6.9510 us/op 4.4510 us/op 1.56
validate api signedAggregateAndProof - struct 2.9730 ms/op 2.4952 ms/op 1.19
validate gossip signedAggregateAndProof - struct 3.0162 ms/op 2.6823 ms/op 1.12
validate gossip attestation - vc 640000 1.4742 ms/op 1.2222 ms/op 1.21
batch validate gossip attestation - vc 640000 - chunk 32 187.84 us/op 142.99 us/op 1.31
batch validate gossip attestation - vc 640000 - chunk 64 155.42 us/op 120.37 us/op 1.29
batch validate gossip attestation - vc 640000 - chunk 128 151.22 us/op 111.85 us/op 1.35
batch validate gossip attestation - vc 640000 - chunk 256 145.96 us/op 108.81 us/op 1.34
pickEth1Vote - no votes 1.4357 ms/op 881.88 us/op 1.63
pickEth1Vote - max votes 18.856 ms/op 7.0239 ms/op 2.68
pickEth1Vote - Eth1Data hashTreeRoot value x2048 25.174 ms/op 14.010 ms/op 1.80
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 36.010 ms/op 25.643 ms/op 1.40
pickEth1Vote - Eth1Data fastSerialize value x2048 690.29 us/op 499.93 us/op 1.38
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.0242 ms/op 5.3258 ms/op 1.13
bytes32 toHexString 554.00 ns/op 587.00 ns/op 0.94
bytes32 Buffer.toString(hex) 290.00 ns/op 336.00 ns/op 0.86
bytes32 Buffer.toString(hex) from Uint8Array 412.00 ns/op 513.00 ns/op 0.80
bytes32 Buffer.toString(hex) + 0x 294.00 ns/op 341.00 ns/op 0.86
Object access 1 prop 0.19100 ns/op 0.24900 ns/op 0.77
Map access 1 prop 0.14800 ns/op 0.18500 ns/op 0.80
Object get x1000 7.3730 ns/op 4.8580 ns/op 1.52
Map get x1000 0.85900 ns/op 0.80500 ns/op 1.07
Object set x1000 64.919 ns/op 33.533 ns/op 1.94
Map set x1000 44.143 ns/op 20.548 ns/op 2.15
Return object 10000 times 0.24810 ns/op 0.23090 ns/op 1.07
Throw Error 10000 times 4.1312 us/op 2.6723 us/op 1.55
fastMsgIdFn sha256 / 200 bytes 3.5190 us/op 1.9720 us/op 1.78
fastMsgIdFn h32 xxhash / 200 bytes 325.00 ns/op 354.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 200 bytes 370.00 ns/op 381.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 11.613 us/op 6.1320 us/op 1.89
fastMsgIdFn h32 xxhash / 1000 bytes 459.00 ns/op 462.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 1000 bytes 487.00 ns/op 451.00 ns/op 1.08
fastMsgIdFn sha256 / 10000 bytes 105.55 us/op 51.596 us/op 2.05
fastMsgIdFn h32 xxhash / 10000 bytes 2.0610 us/op 1.7960 us/op 1.15
fastMsgIdFn h64 xxhash / 10000 bytes 1.4720 us/op 1.2370 us/op 1.19
send data - 1000 256B messages 21.906 ms/op 13.918 ms/op 1.57
send data - 1000 512B messages 28.837 ms/op 17.929 ms/op 1.61
send data - 1000 1024B messages 44.794 ms/op 24.633 ms/op 1.82
send data - 1000 1200B messages 40.214 ms/op 30.021 ms/op 1.34
send data - 1000 2048B messages 28.493 ms/op 33.021 ms/op 0.86
send data - 1000 4096B messages 46.001 ms/op 33.788 ms/op 1.36
send data - 1000 16384B messages 126.97 ms/op 101.33 ms/op 1.25
send data - 1000 65536B messages 505.91 ms/op 412.83 ms/op 1.23
enrSubnets - fastDeserialize 64 bits 1.8410 us/op 972.00 ns/op 1.89
enrSubnets - ssz BitVector 64 bits 544.00 ns/op 416.00 ns/op 1.31
enrSubnets - fastDeserialize 4 bits 239.00 ns/op 201.00 ns/op 1.19
enrSubnets - ssz BitVector 4 bits 563.00 ns/op 419.00 ns/op 1.34
prioritizePeers score -10:0 att 32-0.1 sync 2-0 121.10 us/op 76.200 us/op 1.59
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 161.93 us/op 96.385 us/op 1.68
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 206.61 us/op 154.95 us/op 1.33
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 365.96 us/op 239.63 us/op 1.53
prioritizePeers score 0:0 att 64-1 sync 4-1 448.98 us/op 215.00 us/op 2.09
array of 16000 items push then shift 1.7544 us/op 1.3485 us/op 1.30
LinkedList of 16000 items push then shift 9.5910 ns/op 6.1620 ns/op 1.56
array of 16000 items push then pop 116.44 ns/op 74.249 ns/op 1.57
LinkedList of 16000 items push then pop 8.9600 ns/op 5.8400 ns/op 1.53
array of 24000 items push then shift 2.5046 us/op 1.9415 us/op 1.29
LinkedList of 24000 items push then shift 9.1570 ns/op 6.3300 ns/op 1.45
array of 24000 items push then pop 158.73 ns/op 83.940 ns/op 1.89
LinkedList of 24000 items push then pop 9.1580 ns/op 5.6930 ns/op 1.61
intersect bitArray bitLen 8 6.8140 ns/op 4.9810 ns/op 1.37
intersect array and set length 8 67.368 ns/op 48.644 ns/op 1.38
intersect bitArray bitLen 128 34.826 ns/op 27.750 ns/op 1.25
intersect array and set length 128 950.27 ns/op 680.35 ns/op 1.40
bitArray.getTrueBitIndexes() bitLen 128 1.7850 us/op 1.1440 us/op 1.56
bitArray.getTrueBitIndexes() bitLen 248 2.9480 us/op 1.8670 us/op 1.58
bitArray.getTrueBitIndexes() bitLen 512 5.3200 us/op 3.5530 us/op 1.50
Buffer.concat 32 items 1.0450 us/op 829.00 ns/op 1.26
Uint8Array.set 32 items 1.8440 us/op 1.3250 us/op 1.39
Set add up to 64 items then delete first 5.0539 us/op 1.7582 us/op 2.87
OrderedSet add up to 64 items then delete first 6.6501 us/op 2.9847 us/op 2.23
Set add up to 64 items then delete last 5.4586 us/op 2.0795 us/op 2.62
OrderedSet add up to 64 items then delete last 7.2072 us/op 3.2494 us/op 2.22
Set add up to 64 items then delete middle 5.2416 us/op 2.0276 us/op 2.59
OrderedSet add up to 64 items then delete middle 8.2792 us/op 4.4266 us/op 1.87
Set add up to 128 items then delete first 10.700 us/op 3.9364 us/op 2.72
OrderedSet add up to 128 items then delete first 15.026 us/op 5.8689 us/op 2.56
Set add up to 128 items then delete last 10.672 us/op 3.8456 us/op 2.78
OrderedSet add up to 128 items then delete last 13.756 us/op 6.5900 us/op 2.09
Set add up to 128 items then delete middle 10.472 us/op 4.1522 us/op 2.52
OrderedSet add up to 128 items then delete middle 19.862 us/op 11.651 us/op 1.70
Set add up to 256 items then delete first 22.467 us/op 7.8168 us/op 2.87
OrderedSet add up to 256 items then delete first 30.319 us/op 12.116 us/op 2.50
Set add up to 256 items then delete last 21.569 us/op 7.9230 us/op 2.72
OrderedSet add up to 256 items then delete last 28.865 us/op 12.884 us/op 2.24
Set add up to 256 items then delete middle 21.348 us/op 7.9440 us/op 2.69
OrderedSet add up to 256 items then delete middle 53.368 us/op 36.958 us/op 1.44
transfer serialized Status (84 B) 2.1260 us/op 1.7270 us/op 1.23
copy serialized Status (84 B) 1.7630 us/op 1.5020 us/op 1.17
transfer serialized SignedVoluntaryExit (112 B) 2.1550 us/op 1.6750 us/op 1.29
copy serialized SignedVoluntaryExit (112 B) 1.7970 us/op 1.5040 us/op 1.19
transfer serialized ProposerSlashing (416 B) 2.7040 us/op 1.9840 us/op 1.36
copy serialized ProposerSlashing (416 B) 2.5010 us/op 2.0200 us/op 1.24
transfer serialized Attestation (485 B) 2.7120 us/op 1.9410 us/op 1.40
copy serialized Attestation (485 B) 2.6220 us/op 2.0480 us/op 1.28
transfer serialized AttesterSlashing (33232 B) 2.9890 us/op 1.7900 us/op 1.67
copy serialized AttesterSlashing (33232 B) 10.201 us/op 4.5680 us/op 2.23
transfer serialized Small SignedBeaconBlock (128000 B) 3.8470 us/op 1.8940 us/op 2.03
copy serialized Small SignedBeaconBlock (128000 B) 31.107 us/op 9.7220 us/op 3.20
transfer serialized Avg SignedBeaconBlock (200000 B) 4.6460 us/op 1.9930 us/op 2.33
copy serialized Avg SignedBeaconBlock (200000 B) 45.854 us/op 19.031 us/op 2.41
transfer serialized BlobsSidecar (524380 B) 6.5290 us/op 2.5890 us/op 2.52
copy serialized BlobsSidecar (524380 B) 145.99 us/op 80.964 us/op 1.80
transfer serialized Big SignedBeaconBlock (1000000 B) 5.1660 us/op 3.6670 us/op 1.41
copy serialized Big SignedBeaconBlock (1000000 B) 253.43 us/op 181.29 us/op 1.40
pass gossip attestations to forkchoice per slot 4.0843 ms/op 2.9481 ms/op 1.39
forkChoice updateHead vc 100000 bc 64 eq 0 727.16 us/op 456.61 us/op 1.59
forkChoice updateHead vc 600000 bc 64 eq 0 4.8910 ms/op 3.2174 ms/op 1.52
forkChoice updateHead vc 1000000 bc 64 eq 0 9.0316 ms/op 5.1056 ms/op 1.77
forkChoice updateHead vc 600000 bc 320 eq 0 4.9934 ms/op 3.1946 ms/op 1.56
forkChoice updateHead vc 600000 bc 1200 eq 0 4.7515 ms/op 2.8261 ms/op 1.68
forkChoice updateHead vc 600000 bc 7200 eq 0 6.3599 ms/op 3.9814 ms/op 1.60
forkChoice updateHead vc 600000 bc 64 eq 1000 12.755 ms/op 10.424 ms/op 1.22
forkChoice updateHead vc 600000 bc 64 eq 10000 17.474 ms/op 10.048 ms/op 1.74
forkChoice updateHead vc 600000 bc 64 eq 300000 24.550 ms/op 13.271 ms/op 1.85
computeDeltas 500000 validators 300 proto nodes 7.6913 ms/op 3.4550 ms/op 2.23
computeDeltas 500000 validators 1200 proto nodes 7.3726 ms/op 3.2561 ms/op 2.26
computeDeltas 500000 validators 7200 proto nodes 7.1067 ms/op 2.9964 ms/op 2.37
computeDeltas 750000 validators 300 proto nodes 10.235 ms/op 4.5816 ms/op 2.23
computeDeltas 750000 validators 1200 proto nodes 10.781 ms/op 4.8037 ms/op 2.24
computeDeltas 750000 validators 7200 proto nodes 10.991 ms/op 4.7608 ms/op 2.31
computeDeltas 1400000 validators 300 proto nodes 20.602 ms/op 9.6533 ms/op 2.13
computeDeltas 1400000 validators 1200 proto nodes 20.840 ms/op 9.9941 ms/op 2.09
computeDeltas 1400000 validators 7200 proto nodes 20.424 ms/op 10.418 ms/op 1.96
computeDeltas 2100000 validators 300 proto nodes 33.336 ms/op 14.498 ms/op 2.30
computeDeltas 2100000 validators 1200 proto nodes 31.442 ms/op 15.934 ms/op 1.97
computeDeltas 2100000 validators 7200 proto nodes 29.593 ms/op 15.252 ms/op 1.94
computeProposerBoostScoreFromBalances 500000 validators 3.8757 ms/op 3.5953 ms/op 1.08
computeProposerBoostScoreFromBalances 750000 validators 3.9628 ms/op 3.6121 ms/op 1.10
computeProposerBoostScoreFromBalances 1400000 validators 3.8852 ms/op 3.4807 ms/op 1.12
computeProposerBoostScoreFromBalances 2100000 validators 3.8939 ms/op 3.3788 ms/op 1.15
altair processAttestation - 250000 vs - 7PWei normalcase 3.3020 ms/op 1.7218 ms/op 1.92
altair processAttestation - 250000 vs - 7PWei worstcase 4.8221 ms/op 2.3753 ms/op 2.03
altair processAttestation - setStatus - 1/6 committees join 214.88 us/op 105.17 us/op 2.04
altair processAttestation - setStatus - 1/3 committees join 380.08 us/op 213.45 us/op 1.78
altair processAttestation - setStatus - 1/2 committees join 500.04 us/op 299.93 us/op 1.67
altair processAttestation - setStatus - 2/3 committees join 616.28 us/op 381.09 us/op 1.62
altair processAttestation - setStatus - 4/5 committees join 856.76 us/op 516.30 us/op 1.66
altair processAttestation - setStatus - 100% committees join 1.0418 ms/op 630.06 us/op 1.65
altair processBlock - 250000 vs - 7PWei normalcase 10.520 ms/op 10.102 ms/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase hashState 42.374 ms/op 34.586 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase 40.294 ms/op 33.521 ms/op 1.20
altair processBlock - 250000 vs - 7PWei worstcase hashState 97.839 ms/op 89.338 ms/op 1.10
phase0 processBlock - 250000 vs - 7PWei normalcase 3.1735 ms/op 3.0151 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei worstcase 34.063 ms/op 26.208 ms/op 1.30
altair processEth1Data - 250000 vs - 7PWei normalcase 708.48 us/op 291.12 us/op 2.43
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.183 us/op 6.7010 us/op 1.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 77.932 us/op 39.865 us/op 1.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 27.823 us/op 15.635 us/op 1.78
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.612 us/op 11.916 us/op 1.73
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 219.75 us/op 180.68 us/op 1.22
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4812 ms/op 1.0522 ms/op 1.41
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9138 ms/op 1.7245 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0648 ms/op 1.4161 ms/op 1.46
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.5517 ms/op 2.5231 ms/op 1.80
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.8503 ms/op 1.4623 ms/op 1.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.7919 ms/op 3.7217 ms/op 1.82
Tree 40 250000 create 504.89 ms/op 254.95 ms/op 1.98
Tree 40 250000 get(125000) 218.00 ns/op 112.97 ns/op 1.93
Tree 40 250000 set(125000) 1.5274 us/op 794.09 ns/op 1.92
Tree 40 250000 toArray() 26.059 ms/op 10.903 ms/op 2.39
Tree 40 250000 iterate all - toArray() + loop 25.974 ms/op 11.792 ms/op 2.20
Tree 40 250000 iterate all - get(i) 76.211 ms/op 41.530 ms/op 1.84
MutableVector 250000 create 15.934 ms/op 12.007 ms/op 1.33
MutableVector 250000 get(125000) 7.2910 ns/op 5.5730 ns/op 1.31
MutableVector 250000 set(125000) 341.02 ns/op 200.09 ns/op 1.70
MutableVector 250000 toArray() 4.7997 ms/op 3.1631 ms/op 1.52
MutableVector 250000 iterate all - toArray() + loop 4.8202 ms/op 2.5549 ms/op 1.89
MutableVector 250000 iterate all - get(i) 1.5751 ms/op 1.3602 ms/op 1.16
Array 250000 create 4.2661 ms/op 2.3316 ms/op 1.83
Array 250000 clone - spread 1.5286 ms/op 1.0963 ms/op 1.39
Array 250000 get(125000) 2.0820 ns/op 1.0210 ns/op 2.04
Array 250000 set(125000) 5.6090 ns/op 1.2260 ns/op 4.58
Array 250000 iterate all - loop 183.38 us/op 156.14 us/op 1.17
effectiveBalanceIncrements clone Uint8Array 300000 63.415 us/op 14.057 us/op 4.51
effectiveBalanceIncrements clone MutableVector 300000 520.00 ns/op 392.00 ns/op 1.33
effectiveBalanceIncrements rw all Uint8Array 300000 216.24 us/op 187.48 us/op 1.15
effectiveBalanceIncrements rw all MutableVector 300000 138.90 ms/op 64.235 ms/op 2.16
phase0 afterProcessEpoch - 250000 vs - 7PWei 120.39 ms/op 76.430 ms/op 1.58
phase0 beforeProcessEpoch - 250000 vs - 7PWei 43.893 ms/op 43.747 ms/op 1.00
altair processEpoch - mainnet_e81889 582.30 ms/op 418.35 ms/op 1.39
mainnet_e81889 - altair beforeProcessEpoch 97.452 ms/op 69.134 ms/op 1.41
mainnet_e81889 - altair processJustificationAndFinalization 22.927 us/op 11.289 us/op 2.03
mainnet_e81889 - altair processInactivityUpdates 7.3205 ms/op 4.9713 ms/op 1.47
mainnet_e81889 - altair processRewardsAndPenalties 46.664 ms/op 62.382 ms/op 0.75
mainnet_e81889 - altair processRegistryUpdates 5.1250 us/op 2.0800 us/op 2.46
mainnet_e81889 - altair processSlashings 798.00 ns/op 516.00 ns/op 1.55
mainnet_e81889 - altair processEth1DataReset 1.0170 us/op 673.00 ns/op 1.51
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.5940 ms/op 1.7589 ms/op 0.91
mainnet_e81889 - altair processSlashingsReset 7.9690 us/op 2.6960 us/op 2.96
mainnet_e81889 - altair processRandaoMixesReset 11.727 us/op 4.5380 us/op 2.58
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3540 us/op 925.00 ns/op 1.46
mainnet_e81889 - altair processParticipationFlagUpdates 3.4970 us/op 1.3470 us/op 2.60
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0190 us/op 599.00 ns/op 1.70
mainnet_e81889 - altair afterProcessEpoch 128.40 ms/op 78.239 ms/op 1.64
capella processEpoch - mainnet_e217614 2.2407 s/op 1.7572 s/op 1.28
mainnet_e217614 - capella beforeProcessEpoch 509.96 ms/op 436.64 ms/op 1.17
mainnet_e217614 - capella processJustificationAndFinalization 23.303 us/op 13.647 us/op 1.71
mainnet_e217614 - capella processInactivityUpdates 26.413 ms/op 14.681 ms/op 1.80
mainnet_e217614 - capella processRewardsAndPenalties 419.25 ms/op 375.27 ms/op 1.12
mainnet_e217614 - capella processRegistryUpdates 25.125 us/op 22.893 us/op 1.10
mainnet_e217614 - capella processSlashings 810.00 ns/op 788.00 ns/op 1.03
mainnet_e217614 - capella processEth1DataReset 559.00 ns/op 697.00 ns/op 0.80
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.4031 ms/op 10.253 ms/op 0.53
mainnet_e217614 - capella processSlashingsReset 3.5540 us/op 3.0690 us/op 1.16
mainnet_e217614 - capella processRandaoMixesReset 4.8660 us/op 3.6030 us/op 1.35
mainnet_e217614 - capella processHistoricalRootsUpdate 623.00 ns/op 607.00 ns/op 1.03
mainnet_e217614 - capella processParticipationFlagUpdates 2.9880 us/op 1.9040 us/op 1.57
mainnet_e217614 - capella afterProcessEpoch 308.80 ms/op 216.79 ms/op 1.42
phase0 processEpoch - mainnet_e58758 482.98 ms/op 392.83 ms/op 1.23
mainnet_e58758 - phase0 beforeProcessEpoch 119.52 ms/op 118.07 ms/op 1.01
mainnet_e58758 - phase0 processJustificationAndFinalization 15.545 us/op 14.776 us/op 1.05
mainnet_e58758 - phase0 processRewardsAndPenalties 50.412 ms/op 51.467 ms/op 0.98
mainnet_e58758 - phase0 processRegistryUpdates 12.029 us/op 9.8900 us/op 1.22
mainnet_e58758 - phase0 processSlashings 482.00 ns/op 878.00 ns/op 0.55
mainnet_e58758 - phase0 processEth1DataReset 756.00 ns/op 591.00 ns/op 1.28
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.6716 ms/op 860.23 us/op 1.94
mainnet_e58758 - phase0 processSlashingsReset 3.5730 us/op 3.3270 us/op 1.07
mainnet_e58758 - phase0 processRandaoMixesReset 5.8150 us/op 3.4340 us/op 1.69
mainnet_e58758 - phase0 processHistoricalRootsUpdate 635.00 ns/op 562.00 ns/op 1.13
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.1450 us/op 3.0460 us/op 1.69
mainnet_e58758 - phase0 afterProcessEpoch 100.58 ms/op 63.826 ms/op 1.58
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4503 ms/op 1.0366 ms/op 1.40
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4609 ms/op 1.1648 ms/op 1.25
altair processInactivityUpdates - 250000 normalcase 32.528 ms/op 22.795 ms/op 1.43
altair processInactivityUpdates - 250000 worstcase 32.959 ms/op 19.722 ms/op 1.67
phase0 processRegistryUpdates - 250000 normalcase 11.628 us/op 8.6500 us/op 1.34
phase0 processRegistryUpdates - 250000 badcase_full_deposits 381.87 us/op 401.79 us/op 0.95
phase0 processRegistryUpdates - 250000 worstcase 0.5 147.37 ms/op 104.39 ms/op 1.41
altair processRewardsAndPenalties - 250000 normalcase 65.372 ms/op 45.878 ms/op 1.42
altair processRewardsAndPenalties - 250000 worstcase 66.905 ms/op 50.807 ms/op 1.32
phase0 getAttestationDeltas - 250000 normalcase 12.166 ms/op 5.3032 ms/op 2.29
phase0 getAttestationDeltas - 250000 worstcase 13.036 ms/op 5.7787 ms/op 2.26
phase0 processSlashings - 250000 worstcase 136.86 us/op 88.375 us/op 1.55
altair processSyncCommitteeUpdates - 250000 179.86 ms/op 115.68 ms/op 1.55
BeaconState.hashTreeRoot - No change 275.00 ns/op 320.00 ns/op 0.86
BeaconState.hashTreeRoot - 1 full validator 173.53 us/op 143.20 us/op 1.21
BeaconState.hashTreeRoot - 32 full validator 1.8203 ms/op 1.6109 ms/op 1.13
BeaconState.hashTreeRoot - 512 full validator 20.206 ms/op 13.583 ms/op 1.49
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 206.97 us/op 135.68 us/op 1.53
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 3.5765 ms/op 1.6659 ms/op 2.15
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 40.321 ms/op 25.381 ms/op 1.59
BeaconState.hashTreeRoot - 1 balances 212.31 us/op 113.39 us/op 1.87
BeaconState.hashTreeRoot - 32 balances 1.7423 ms/op 1.0267 ms/op 1.70
BeaconState.hashTreeRoot - 512 balances 18.422 ms/op 9.3902 ms/op 1.96
BeaconState.hashTreeRoot - 250000 balances 287.91 ms/op 195.20 ms/op 1.47
aggregationBits - 2048 els - zipIndexesInBitList 33.136 us/op 17.797 us/op 1.86
byteArrayEquals 32 83.970 ns/op 61.393 ns/op 1.37
Buffer.compare 32 61.596 ns/op 34.766 ns/op 1.77
byteArrayEquals 1024 2.5613 us/op 1.6288 us/op 1.57
Buffer.compare 1024 80.821 ns/op 40.545 ns/op 1.99
byteArrayEquals 16384 36.885 us/op 26.062 us/op 1.42
Buffer.compare 16384 274.12 ns/op 216.07 ns/op 1.27
byteArrayEquals 123687377 257.64 ms/op 208.34 ms/op 1.24
Buffer.compare 123687377 7.7685 ms/op 4.0651 ms/op 1.91
byteArrayEquals 32 - diff last byte 74.553 ns/op 61.654 ns/op 1.21
Buffer.compare 32 - diff last byte 59.088 ns/op 39.148 ns/op 1.51
byteArrayEquals 1024 - diff last byte 2.0853 us/op 1.7578 us/op 1.19
Buffer.compare 1024 - diff last byte 73.511 ns/op 48.395 ns/op 1.52
byteArrayEquals 16384 - diff last byte 34.501 us/op 28.065 us/op 1.23
Buffer.compare 16384 - diff last byte 261.94 ns/op 191.26 ns/op 1.37
byteArrayEquals 123687377 - diff last byte 256.89 ms/op 201.94 ms/op 1.27
Buffer.compare 123687377 - diff last byte 9.3172 ms/op 4.1571 ms/op 2.24
byteArrayEquals 32 - random bytes 6.4650 ns/op 4.7050 ns/op 1.37
Buffer.compare 32 - random bytes 64.682 ns/op 40.989 ns/op 1.58
byteArrayEquals 1024 - random bytes 6.5220 ns/op 4.5220 ns/op 1.44
Buffer.compare 1024 - random bytes 64.235 ns/op 38.110 ns/op 1.69
byteArrayEquals 16384 - random bytes 7.3060 ns/op 4.5050 ns/op 1.62
Buffer.compare 16384 - random bytes 65.414 ns/op 36.659 ns/op 1.78
byteArrayEquals 123687377 - random bytes 9.8100 ns/op 7.9300 ns/op 1.24
Buffer.compare 123687377 - random bytes 79.050 ns/op 41.230 ns/op 1.92
regular array get 100000 times 47.537 us/op 41.018 us/op 1.16
wrappedArray get 100000 times 47.549 us/op 41.062 us/op 1.16
arrayWithProxy get 100000 times 15.511 ms/op 9.9687 ms/op 1.56
ssz.Root.equals 56.551 ns/op 54.692 ns/op 1.03
byteArrayEquals 56.215 ns/op 53.997 ns/op 1.04
Buffer.compare 12.619 ns/op 9.7890 ns/op 1.29
shuffle list - 16384 els 7.3045 ms/op 4.6169 ms/op 1.58
shuffle list - 250000 els 108.61 ms/op 68.686 ms/op 1.58
processSlot - 1 slots 25.109 us/op 19.009 us/op 1.32
processSlot - 32 slots 3.7659 ms/op 4.0688 ms/op 0.93
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 66.067 ms/op 50.962 ms/op 1.30
getCommitteeAssignments - req 1 vs - 250000 vc 2.6795 ms/op 2.2500 ms/op 1.19
getCommitteeAssignments - req 100 vs - 250000 vc 3.8413 ms/op 3.3909 ms/op 1.13
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1656 ms/op 3.6551 ms/op 1.14
findModifiedValidators - 10000 modified validators 575.13 ms/op 428.99 ms/op 1.34
findModifiedValidators - 1000 modified validators 482.39 ms/op 313.98 ms/op 1.54
findModifiedValidators - 100 modified validators 397.10 ms/op 319.86 ms/op 1.24
findModifiedValidators - 10 modified validators 447.03 ms/op 304.69 ms/op 1.47
findModifiedValidators - 1 modified validators 404.58 ms/op 305.38 ms/op 1.32
findModifiedValidators - no difference 454.12 ms/op 321.87 ms/op 1.41
compare ViewDUs 5.0419 s/op 3.7064 s/op 1.36
compare each validator Uint8Array 1.8645 s/op 1.7187 s/op 1.08
compare ViewDU to Uint8Array 1.3776 s/op 739.74 ms/op 1.86
migrate state 1000000 validators, 24 modified, 0 new 921.27 ms/op 689.06 ms/op 1.34
migrate state 1000000 validators, 1700 modified, 1000 new 1.2859 s/op 917.39 ms/op 1.40
migrate state 1000000 validators, 3400 modified, 2000 new 1.4991 s/op 1.1144 s/op 1.35
migrate state 1500000 validators, 24 modified, 0 new 937.54 ms/op 831.21 ms/op 1.13
migrate state 1500000 validators, 1700 modified, 1000 new 1.3118 s/op 1.2161 s/op 1.08
migrate state 1500000 validators, 3400 modified, 2000 new 1.4700 s/op 1.5016 s/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.3100 ns/op 5.3300 ns/op 1.00
state getBlockRootAtSlot - 250000 vs - 7PWei 750.34 ns/op 753.73 ns/op 1.00
computeProposers - vc 250000 10.628 ms/op 7.4643 ms/op 1.42
computeEpochShuffling - vc 250000 110.25 ms/op 82.214 ms/op 1.34
getNextSyncCommittee - vc 250000 175.26 ms/op 124.46 ms/op 1.41
computeSigningRoot for AttestationData 27.067 us/op 27.718 us/op 0.98
hash AttestationData serialized data then Buffer.toString(base64) 2.4095 us/op 1.4031 us/op 1.72
toHexString serialized data 1.1117 us/op 844.84 ns/op 1.32
Buffer.toString(base64) 236.63 ns/op 152.35 ns/op 1.55

by benchmarkbot/action

@@ -1298,6 +1298,11 @@ export function createLodestarMetrics(
name: "lodestar_precompute_next_epoch_transition_waste_total",
help: "Total number of precomputing next epoch transition wasted",
}),
duration: register.histogram({
name: "lodestar_precompute_next_epoch_transition_duration_seconds",
help: "Duration of precomputeNextEpochTransition at lodestar side",
Copy link
Member

Choose a reason for hiding this comment

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

The "at lodestar side" might be confusing, are we precomputing the next epoch transition somewhere else (not in lodestar)?

Looking at the code the two major tasks we do are

  • precompute next epoch transition
  • and prepare execution payload

Might be missing something

Copy link
Member

Choose a reason for hiding this comment

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

There's also the prepareExecutionPayload call that's not included in this timer.

Copy link
Member

Choose a reason for hiding this comment

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

But isn't that a different task or maybe I misunderstand what is meant by precomputeEpochTransition, my assumption is this includes epoch transition + hashing the state.

From my understanding the "at lodestar side" is redundant and can be removed as the task precomputeNextEpochTransition is only executed by Lodestar.

prepareExecutionPayload is part of preparing for next slot but not part of precomputing the epoch transition.

wemeetagain
wemeetagain previously approved these changes Jan 8, 2024
@wemeetagain wemeetagain enabled auto-merge (squash) January 8, 2024 20:49
@nflaig nflaig enabled auto-merge (squash) January 8, 2024 20:57
@nflaig nflaig disabled auto-merge January 8, 2024 21:02
@wemeetagain wemeetagain merged commit 3c6420a into unstable Jan 8, 2024
14 of 15 checks passed
@wemeetagain wemeetagain deleted the tuyen/track_prepare_next_epoch branch January 8, 2024 22:00
@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
* feat: track prepare next epoch time

* Update packages/beacon-node/src/metrics/metrics/lodestar.ts

* Align variable name of timer with histogram naming

---------

Co-authored-by: Cayman <caymannava@gmail.com>
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants