Skip to content

refactor: slight improvement on updating metrics in AggregatedAttestationPool #7672

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

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Apr 8, 2025

Slight improvement on onScrapeMetrics introduced in #7656.

We loop over every attestation group of previousSlot twice which can be reduced to one.

@ensi321 ensi321 marked this pull request as ready for review April 8, 2025 06:19
@ensi321 ensi321 requested a review from a team as a code owner April 8, 2025 06:19
@ensi321 ensi321 changed the title chore: slight improvement on updating metrics in AggregatedAttestationPool refactor: slight improvement on updating metrics in AggregatedAttestationPool Apr 8, 2025
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.18%. Comparing base (f87bd54) to head (317ea10).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7672      +/-   ##
============================================
- Coverage     50.18%   50.18%   -0.01%     
============================================
  Files           604      604              
  Lines         40533    40533              
  Branches       2224     2222       -2     
============================================
- Hits          20343    20340       -3     
- Misses        20148    20151       +3     
  Partials         42       42              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Apr 8, 2025

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: ec169c9 Previous: c76151c Ratio
forkChoice updateHead vc 600000 bc 1200 eq 0 10.275 ms/op 2.7611 ms/op 3.72
Array.fill - length 1000000 8.3960 ms/op 2.6698 ms/op 3.14
Full benchmark results
Benchmark suite Current: ec169c9 Previous: c76151c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.2676 ms/op 790.14 us/op 1.60
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 48.360 us/op 31.917 us/op 1.52
BLS verify - blst 1.0574 ms/op 915.87 us/op 1.15
BLS verifyMultipleSignatures 3 - blst 1.7033 ms/op 1.3090 ms/op 1.30
BLS verifyMultipleSignatures 8 - blst 2.5792 ms/op 2.1289 ms/op 1.21
BLS verifyMultipleSignatures 32 - blst 7.6946 ms/op 4.4892 ms/op 1.71
BLS verifyMultipleSignatures 64 - blst 13.236 ms/op 8.3921 ms/op 1.58
BLS verifyMultipleSignatures 128 - blst 25.689 ms/op 16.034 ms/op 1.60
BLS deserializing 10000 signatures 879.70 ms/op 638.86 ms/op 1.38
BLS deserializing 100000 signatures 8.5750 s/op 6.3556 s/op 1.35
BLS verifyMultipleSignatures - same message - 3 - blst 1.0893 ms/op 935.14 us/op 1.16
BLS verifyMultipleSignatures - same message - 8 - blst 1.3775 ms/op 1.1204 ms/op 1.23
BLS verifyMultipleSignatures - same message - 32 - blst 2.2118 ms/op 1.7110 ms/op 1.29
BLS verifyMultipleSignatures - same message - 64 - blst 3.2526 ms/op 2.4731 ms/op 1.32
BLS verifyMultipleSignatures - same message - 128 - blst 5.1621 ms/op 4.0916 ms/op 1.26
BLS aggregatePubkeys 32 - blst 23.091 us/op 17.552 us/op 1.32
BLS aggregatePubkeys 128 - blst 85.419 us/op 61.185 us/op 1.40
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 70.107 ms/op 47.341 ms/op 1.48
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 61.390 ms/op 42.192 ms/op 1.45
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 43.635 ms/op 37.783 ms/op 1.15
getSlashingsAndExits - default max 89.299 us/op 47.211 us/op 1.89
getSlashingsAndExits - 2k 365.75 us/op 285.84 us/op 1.28
proposeBlockBody type=full, size=empty 6.0771 ms/op 5.1029 ms/op 1.19
isKnown best case - 1 super set check 239.00 ns/op 391.00 ns/op 0.61
isKnown normal case - 2 super set checks 233.00 ns/op 384.00 ns/op 0.61
isKnown worse case - 16 super set checks 221.00 ns/op 383.00 ns/op 0.58
InMemoryCheckpointStateCache - add get delete 2.9810 us/op 2.4080 us/op 1.24
validate api signedAggregateAndProof - struct 1.6164 ms/op 1.4080 ms/op 1.15
validate gossip signedAggregateAndProof - struct 1.9189 ms/op 1.4121 ms/op 1.36
batch validate gossip attestation - vc 640000 - chunk 32 146.87 us/op 106.91 us/op 1.37
batch validate gossip attestation - vc 640000 - chunk 64 131.26 us/op 93.918 us/op 1.40
batch validate gossip attestation - vc 640000 - chunk 128 138.78 us/op 86.803 us/op 1.60
batch validate gossip attestation - vc 640000 - chunk 256 133.21 us/op 84.897 us/op 1.57
pickEth1Vote - no votes 1.1886 ms/op 782.98 us/op 1.52
pickEth1Vote - max votes 10.825 ms/op 4.2210 ms/op 2.56
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.158 ms/op 8.6764 ms/op 1.86
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.732 ms/op 11.210 ms/op 2.30
pickEth1Vote - Eth1Data fastSerialize value x2048 872.97 us/op 346.09 us/op 2.52
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.3777 ms/op 1.9523 ms/op 2.75
bytes32 toHexString 470.00 ns/op 520.00 ns/op 0.90
bytes32 Buffer.toString(hex) 325.00 ns/op 418.00 ns/op 0.78
bytes32 Buffer.toString(hex) from Uint8Array 437.00 ns/op 499.00 ns/op 0.88
bytes32 Buffer.toString(hex) + 0x 317.00 ns/op 417.00 ns/op 0.76
Object access 1 prop 0.14400 ns/op 0.33100 ns/op 0.44
Map access 1 prop 0.17800 ns/op 0.31700 ns/op 0.56
Object get x1000 8.0760 ns/op 5.1020 ns/op 1.58
Map get x1000 9.2300 ns/op 5.7500 ns/op 1.61
Object set x1000 38.491 ns/op 18.387 ns/op 2.09
Map set x1000 26.514 ns/op 16.257 ns/op 1.63
Return object 10000 times 0.35380 ns/op 0.29390 ns/op 1.20
Throw Error 10000 times 6.0563 us/op 3.4914 us/op 1.73
toHex 168.48 ns/op 99.443 ns/op 1.69
Buffer.from 142.34 ns/op 94.256 ns/op 1.51
shared Buffer 104.80 ns/op 64.899 ns/op 1.61
fastMsgIdFn sha256 / 200 bytes 2.5920 us/op 1.9510 us/op 1.33
fastMsgIdFn h32 xxhash / 200 bytes 221.00 ns/op 385.00 ns/op 0.57
fastMsgIdFn h64 xxhash / 200 bytes 338.00 ns/op 434.00 ns/op 0.78
fastMsgIdFn sha256 / 1000 bytes 8.3550 us/op 5.8890 us/op 1.42
fastMsgIdFn h32 xxhash / 1000 bytes 405.00 ns/op 603.00 ns/op 0.67
fastMsgIdFn h64 xxhash / 1000 bytes 381.00 ns/op 594.00 ns/op 0.64
fastMsgIdFn sha256 / 10000 bytes 77.381 us/op 48.667 us/op 1.59
fastMsgIdFn h32 xxhash / 10000 bytes 2.2500 us/op 1.8940 us/op 1.19
fastMsgIdFn h64 xxhash / 10000 bytes 1.5330 us/op 1.3160 us/op 1.16
send data - 1000 256B messages 16.070 ms/op 9.0755 ms/op 1.77
send data - 1000 512B messages 21.262 ms/op 13.455 ms/op 1.58
send data - 1000 1024B messages 34.476 ms/op 21.647 ms/op 1.59
send data - 1000 1200B messages 33.187 ms/op 14.356 ms/op 2.31
send data - 1000 2048B messages 35.017 ms/op 14.243 ms/op 2.46
send data - 1000 4096B messages 45.153 ms/op 16.361 ms/op 2.76
send data - 1000 16384B messages 84.074 ms/op 52.007 ms/op 1.62
send data - 1000 65536B messages 427.11 ms/op 330.23 ms/op 1.29
enrSubnets - fastDeserialize 64 bits 1.1020 us/op 976.00 ns/op 1.13
enrSubnets - ssz BitVector 64 bits 411.00 ns/op 483.00 ns/op 0.85
enrSubnets - fastDeserialize 4 bits 169.00 ns/op 358.00 ns/op 0.47
enrSubnets - ssz BitVector 4 bits 400.00 ns/op 490.00 ns/op 0.82
prioritizePeers score -10:0 att 32-0.1 sync 2-0 152.63 us/op 96.721 us/op 1.58
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 171.47 us/op 115.01 us/op 1.49
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 263.06 us/op 180.39 us/op 1.46
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 481.75 us/op 312.62 us/op 1.54
prioritizePeers score 0:0 att 64-1 sync 4-1 593.43 us/op 372.08 us/op 1.59
array of 16000 items push then shift 1.9762 us/op 1.2845 us/op 1.54
LinkedList of 16000 items push then shift 8.8510 ns/op 6.2050 ns/op 1.43
array of 16000 items push then pop 107.71 ns/op 61.146 ns/op 1.76
LinkedList of 16000 items push then pop 10.099 ns/op 6.1240 ns/op 1.65
array of 24000 items push then shift 3.0360 us/op 1.8872 us/op 1.61
LinkedList of 24000 items push then shift 10.227 ns/op 6.2520 ns/op 1.64
array of 24000 items push then pop 144.58 ns/op 85.859 ns/op 1.68
LinkedList of 24000 items push then pop 9.3570 ns/op 6.0530 ns/op 1.55
intersect bitArray bitLen 8 7.4730 ns/op 5.0780 ns/op 1.47
intersect array and set length 8 45.473 ns/op 31.142 ns/op 1.46
intersect bitArray bitLen 128 37.351 ns/op 25.619 ns/op 1.46
intersect array and set length 128 730.82 ns/op 589.97 ns/op 1.24
bitArray.getTrueBitIndexes() bitLen 128 1.3230 us/op 1.2210 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 248 2.2210 us/op 1.9220 us/op 1.16
bitArray.getTrueBitIndexes() bitLen 512 4.6200 us/op 3.6170 us/op 1.28
Buffer.concat 32 items 967.00 ns/op 713.00 ns/op 1.36
Uint8Array.set 32 items 1.8510 us/op 946.00 ns/op 1.96
Buffer.copy 2.5280 us/op 1.8290 us/op 1.38
Uint8Array.set - with subarray 2.9750 us/op 1.5210 us/op 1.96
Uint8Array.set - without subarray 1.8120 us/op 1.0150 us/op 1.79
getUint32 - dataview 224.00 ns/op 372.00 ns/op 0.60
getUint32 - manual 144.00 ns/op 296.00 ns/op 0.49
Set add up to 64 items then delete first 3.2858 us/op 1.7227 us/op 1.91
OrderedSet add up to 64 items then delete first 4.8851 us/op 2.7095 us/op 1.80
Set add up to 64 items then delete last 3.5665 us/op 2.1009 us/op 1.70
OrderedSet add up to 64 items then delete last 5.3198 us/op 3.0635 us/op 1.74
Set add up to 64 items then delete middle 2.9279 us/op 1.9658 us/op 1.49
OrderedSet add up to 64 items then delete middle 9.9611 us/op 4.5215 us/op 2.20
Set add up to 128 items then delete first 9.9402 us/op 5.1024 us/op 1.95
OrderedSet add up to 128 items then delete first 12.511 us/op 6.2513 us/op 2.00
Set add up to 128 items then delete last 8.2058 us/op 4.5515 us/op 1.80
OrderedSet add up to 128 items then delete last 11.134 us/op 6.6876 us/op 1.66
Set add up to 128 items then delete middle 7.1560 us/op 4.3762 us/op 1.64
OrderedSet add up to 128 items then delete middle 19.909 us/op 15.728 us/op 1.27
Set add up to 256 items then delete first 14.365 us/op 10.384 us/op 1.38
OrderedSet add up to 256 items then delete first 23.471 us/op 12.233 us/op 1.92
Set add up to 256 items then delete last 13.509 us/op 7.3272 us/op 1.84
OrderedSet add up to 256 items then delete last 19.826 us/op 15.844 us/op 1.25
Set add up to 256 items then delete middle 13.935 us/op 11.354 us/op 1.23
OrderedSet add up to 256 items then delete middle 54.430 us/op 39.429 us/op 1.38
transfer serialized Status (84 B) 2.7180 us/op 2.0030 us/op 1.36
copy serialized Status (84 B) 1.5430 us/op 1.2420 us/op 1.24
transfer serialized SignedVoluntaryExit (112 B) 2.6960 us/op 1.9810 us/op 1.36
copy serialized SignedVoluntaryExit (112 B) 1.6900 us/op 1.3320 us/op 1.27
transfer serialized ProposerSlashing (416 B) 3.2950 us/op 2.6490 us/op 1.24
copy serialized ProposerSlashing (416 B) 2.2300 us/op 1.8050 us/op 1.24
transfer serialized Attestation (485 B) 3.6980 us/op 2.5150 us/op 1.47
copy serialized Attestation (485 B) 2.6280 us/op 1.8750 us/op 1.40
transfer serialized AttesterSlashing (33232 B) 4.3160 us/op 2.7810 us/op 1.55
copy serialized AttesterSlashing (33232 B) 6.7530 us/op 4.9610 us/op 1.36
transfer serialized Small SignedBeaconBlock (128000 B) 6.2930 us/op 2.9460 us/op 2.14
copy serialized Small SignedBeaconBlock (128000 B) 18.487 us/op 10.281 us/op 1.80
transfer serialized Avg SignedBeaconBlock (200000 B) 6.4600 us/op 3.0160 us/op 2.14
copy serialized Avg SignedBeaconBlock (200000 B) 26.402 us/op 9.4950 us/op 2.78
transfer serialized BlobsSidecar (524380 B) 11.430 us/op 3.9070 us/op 2.93
copy serialized BlobsSidecar (524380 B) 112.78 us/op 58.986 us/op 1.91
transfer serialized Big SignedBeaconBlock (1000000 B) 9.3800 us/op 4.6450 us/op 2.02
copy serialized Big SignedBeaconBlock (1000000 B) 244.79 us/op 129.74 us/op 1.89
pass gossip attestations to forkchoice per slot 3.4895 ms/op 2.4713 ms/op 1.41
forkChoice updateHead vc 100000 bc 64 eq 0 592.56 us/op 363.28 us/op 1.63
forkChoice updateHead vc 600000 bc 64 eq 0 5.0618 ms/op 3.1336 ms/op 1.62
forkChoice updateHead vc 1000000 bc 64 eq 0 8.4257 ms/op 5.3634 ms/op 1.57
forkChoice updateHead vc 600000 bc 320 eq 0 5.2074 ms/op 2.8899 ms/op 1.80
forkChoice updateHead vc 600000 bc 1200 eq 0 10.275 ms/op 2.7611 ms/op 3.72
forkChoice updateHead vc 600000 bc 7200 eq 0 7.7835 ms/op 3.0251 ms/op 2.57
forkChoice updateHead vc 600000 bc 64 eq 1000 17.903 ms/op 10.187 ms/op 1.76
forkChoice updateHead vc 600000 bc 64 eq 10000 15.113 ms/op 10.012 ms/op 1.51
forkChoice updateHead vc 600000 bc 64 eq 300000 37.403 ms/op 15.031 ms/op 2.49
computeDeltas 500000 validators 300 proto nodes 5.2803 ms/op 3.4008 ms/op 1.55
computeDeltas 500000 validators 1200 proto nodes 4.9677 ms/op 3.7785 ms/op 1.31
computeDeltas 500000 validators 7200 proto nodes 5.0859 ms/op 3.5490 ms/op 1.43
computeDeltas 750000 validators 300 proto nodes 7.2065 ms/op 5.1694 ms/op 1.39
computeDeltas 750000 validators 1200 proto nodes 7.1390 ms/op 4.6718 ms/op 1.53
computeDeltas 750000 validators 7200 proto nodes 6.8525 ms/op 4.6702 ms/op 1.47
computeDeltas 1400000 validators 300 proto nodes 12.913 ms/op 8.7656 ms/op 1.47
computeDeltas 1400000 validators 1200 proto nodes 13.269 ms/op 8.7964 ms/op 1.51
computeDeltas 1400000 validators 7200 proto nodes 13.406 ms/op 8.7872 ms/op 1.53
computeDeltas 2100000 validators 300 proto nodes 20.758 ms/op 13.517 ms/op 1.54
computeDeltas 2100000 validators 1200 proto nodes 20.314 ms/op 13.255 ms/op 1.53
computeDeltas 2100000 validators 7200 proto nodes 21.056 ms/op 13.030 ms/op 1.62
altair processAttestation - 250000 vs - 7PWei normalcase 3.7757 ms/op 1.8634 ms/op 2.03
altair processAttestation - 250000 vs - 7PWei worstcase 5.0921 ms/op 2.9724 ms/op 1.71
altair processAttestation - setStatus - 1/6 committees join 176.37 us/op 122.68 us/op 1.44
altair processAttestation - setStatus - 1/3 committees join 304.50 us/op 200.84 us/op 1.52
altair processAttestation - setStatus - 1/2 committees join 471.13 us/op 284.60 us/op 1.66
altair processAttestation - setStatus - 2/3 committees join 559.43 us/op 400.50 us/op 1.40
altair processAttestation - setStatus - 4/5 committees join 739.11 us/op 579.45 us/op 1.28
altair processAttestation - setStatus - 100% committees join 917.83 us/op 607.67 us/op 1.51
altair processBlock - 250000 vs - 7PWei normalcase 6.3360 ms/op 3.7372 ms/op 1.70
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.111 ms/op 27.203 ms/op 1.44
altair processBlock - 250000 vs - 7PWei worstcase 52.420 ms/op 35.023 ms/op 1.50
altair processBlock - 250000 vs - 7PWei worstcase hashState 104.38 ms/op 64.116 ms/op 1.63
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5491 ms/op 1.6477 ms/op 1.55
phase0 processBlock - 250000 vs - 7PWei worstcase 33.121 ms/op 26.847 ms/op 1.23
altair processEth1Data - 250000 vs - 7PWei normalcase 431.10 us/op 274.63 us/op 1.57
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.2860 us/op 5.5360 us/op 1.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 43.399 us/op 29.001 us/op 1.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.5710 us/op 7.6010 us/op 1.26
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.646 us/op 4.7930 us/op 2.22
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 136.85 us/op 123.50 us/op 1.11
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2311 ms/op 859.99 us/op 1.43
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.6472 ms/op 1.1942 ms/op 1.38
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8642 ms/op 1.1312 ms/op 1.65
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.0739 ms/op 2.9060 ms/op 1.40
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.7509 ms/op 1.1693 ms/op 1.50
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.2683 ms/op 3.0714 ms/op 1.39
Tree 40 250000 create 709.06 ms/op 444.31 ms/op 1.60
Tree 40 250000 get(125000) 191.96 ns/op 110.50 ns/op 1.74
Tree 40 250000 set(125000) 2.6268 us/op 1.6372 us/op 1.60
Tree 40 250000 toArray() 22.842 ms/op 18.880 ms/op 1.21
Tree 40 250000 iterate all - toArray() + loop 22.904 ms/op 21.372 ms/op 1.07
Tree 40 250000 iterate all - get(i) 71.636 ms/op 47.304 ms/op 1.51
Array 250000 create 4.4185 ms/op 2.1192 ms/op 2.08
Array 250000 clone - spread 2.0350 ms/op 663.98 us/op 3.06
Array 250000 get(125000) 0.48500 ns/op 0.57700 ns/op 0.84
Array 250000 set(125000) 0.65100 ns/op 0.58400 ns/op 1.11
Array 250000 iterate all - loop 138.25 us/op 74.176 us/op 1.86
phase0 afterProcessEpoch - 250000 vs - 7PWei 53.785 ms/op 38.825 ms/op 1.39
Array.fill - length 1000000 8.3960 ms/op 2.6698 ms/op 3.14
Array push - length 1000000 19.340 ms/op 14.051 ms/op 1.38
Array.get 0.32065 ns/op 0.25287 ns/op 1.27
Uint8Array.get 0.51771 ns/op 0.33601 ns/op 1.54
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.513 ms/op 19.499 ms/op 0.95
altair processEpoch - mainnet_e81889 345.84 ms/op 265.34 ms/op 1.30
mainnet_e81889 - altair beforeProcessEpoch 22.254 ms/op 15.445 ms/op 1.44
mainnet_e81889 - altair processJustificationAndFinalization 6.7670 us/op 4.6430 us/op 1.46
mainnet_e81889 - altair processInactivityUpdates 6.8803 ms/op 3.5558 ms/op 1.93
mainnet_e81889 - altair processRewardsAndPenalties 51.997 ms/op 40.550 ms/op 1.28
mainnet_e81889 - altair processRegistryUpdates 1.2000 us/op 945.00 ns/op 1.27
mainnet_e81889 - altair processSlashings 218.00 ns/op 432.00 ns/op 0.50
mainnet_e81889 - altair processEth1DataReset 225.00 ns/op 393.00 ns/op 0.57
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4893 ms/op 981.41 us/op 1.52
mainnet_e81889 - altair processSlashingsReset 1.1030 us/op 1.2810 us/op 0.86
mainnet_e81889 - altair processRandaoMixesReset 1.3850 us/op 1.4110 us/op 0.98
mainnet_e81889 - altair processHistoricalRootsUpdate 214.00 ns/op 397.00 ns/op 0.54
mainnet_e81889 - altair processParticipationFlagUpdates 637.00 ns/op 730.00 ns/op 0.87
mainnet_e81889 - altair processSyncCommitteeUpdates 157.00 ns/op 367.00 ns/op 0.43
mainnet_e81889 - altair afterProcessEpoch 51.177 ms/op 40.648 ms/op 1.26
capella processEpoch - mainnet_e217614 1.2467 s/op 977.49 ms/op 1.28
mainnet_e217614 - capella beforeProcessEpoch 69.757 ms/op 57.478 ms/op 1.21
mainnet_e217614 - capella processJustificationAndFinalization 6.6140 us/op 4.2970 us/op 1.54
mainnet_e217614 - capella processInactivityUpdates 17.470 ms/op 11.084 ms/op 1.58
mainnet_e217614 - capella processRewardsAndPenalties 213.22 ms/op 192.80 ms/op 1.11
mainnet_e217614 - capella processRegistryUpdates 9.7760 us/op 6.0710 us/op 1.61
mainnet_e217614 - capella processSlashings 281.00 ns/op 387.00 ns/op 0.73
mainnet_e217614 - capella processEth1DataReset 246.00 ns/op 386.00 ns/op 0.64
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.9411 ms/op 3.2301 ms/op 1.53
mainnet_e217614 - capella processSlashingsReset 1.2670 us/op 1.2350 us/op 1.03
mainnet_e217614 - capella processRandaoMixesReset 1.5640 us/op 1.2700 us/op 1.23
mainnet_e217614 - capella processHistoricalRootsUpdate 221.00 ns/op 399.00 ns/op 0.55
mainnet_e217614 - capella processParticipationFlagUpdates 613.00 ns/op 696.00 ns/op 0.88
mainnet_e217614 - capella afterProcessEpoch 139.19 ms/op 108.77 ms/op 1.28
phase0 processEpoch - mainnet_e58758 348.18 ms/op 273.45 ms/op 1.27
mainnet_e58758 - phase0 beforeProcessEpoch 90.760 ms/op 72.755 ms/op 1.25
mainnet_e58758 - phase0 processJustificationAndFinalization 8.0810 us/op 4.7970 us/op 1.68
mainnet_e58758 - phase0 processRewardsAndPenalties 47.658 ms/op 40.031 ms/op 1.19
mainnet_e58758 - phase0 processRegistryUpdates 3.6320 us/op 2.6650 us/op 1.36
mainnet_e58758 - phase0 processSlashings 225.00 ns/op 382.00 ns/op 0.59
mainnet_e58758 - phase0 processEth1DataReset 206.00 ns/op 379.00 ns/op 0.54
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3301 ms/op 988.00 us/op 1.35
mainnet_e58758 - phase0 processSlashingsReset 1.0130 us/op 935.00 ns/op 1.08
mainnet_e58758 - phase0 processRandaoMixesReset 1.4830 us/op 1.3340 us/op 1.11
mainnet_e58758 - phase0 processHistoricalRootsUpdate 218.00 ns/op 400.00 ns/op 0.55
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0800 us/op 1.1950 us/op 0.90
mainnet_e58758 - phase0 afterProcessEpoch 41.487 ms/op 32.378 ms/op 1.28
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.8058 ms/op 933.22 us/op 1.94
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2231 ms/op 1.8122 ms/op 1.23
altair processInactivityUpdates - 250000 normalcase 20.945 ms/op 20.136 ms/op 1.04
altair processInactivityUpdates - 250000 worstcase 20.949 ms/op 17.904 ms/op 1.17
phase0 processRegistryUpdates - 250000 normalcase 6.8420 us/op 5.6800 us/op 1.20
phase0 processRegistryUpdates - 250000 badcase_full_deposits 324.15 us/op 295.02 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 131.38 ms/op 106.70 ms/op 1.23
altair processRewardsAndPenalties - 250000 normalcase 31.689 ms/op 28.275 ms/op 1.12
altair processRewardsAndPenalties - 250000 worstcase 30.132 ms/op 28.283 ms/op 1.07
phase0 getAttestationDeltas - 250000 normalcase 8.4300 ms/op 4.5409 ms/op 1.86
phase0 getAttestationDeltas - 250000 worstcase 6.5291 ms/op 5.3740 ms/op 1.21
phase0 processSlashings - 250000 worstcase 91.225 us/op 82.333 us/op 1.11
altair processSyncCommitteeUpdates - 250000 12.376 ms/op 9.8118 ms/op 1.26
BeaconState.hashTreeRoot - No change 249.00 ns/op 422.00 ns/op 0.59
BeaconState.hashTreeRoot - 1 full validator 90.512 us/op 88.650 us/op 1.02
BeaconState.hashTreeRoot - 32 full validator 1.0610 ms/op 733.23 us/op 1.45
BeaconState.hashTreeRoot - 512 full validator 11.739 ms/op 8.3144 ms/op 1.41
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 123.60 us/op 87.543 us/op 1.41
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6151 ms/op 1.2336 ms/op 1.31
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 30.336 ms/op 15.171 ms/op 2.00
BeaconState.hashTreeRoot - 1 balances 89.852 us/op 85.599 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 1.0087 ms/op 678.42 us/op 1.49
BeaconState.hashTreeRoot - 512 balances 8.5969 ms/op 5.6341 ms/op 1.53
BeaconState.hashTreeRoot - 250000 balances 220.85 ms/op 180.65 ms/op 1.22
aggregationBits - 2048 els - zipIndexesInBitList 24.780 us/op 21.873 us/op 1.13
byteArrayEquals 32 59.899 ns/op 46.708 ns/op 1.28
Buffer.compare 32 19.810 ns/op 20.912 ns/op 0.95
byteArrayEquals 1024 1.8433 us/op 1.2058 us/op 1.53
Buffer.compare 1024 27.991 ns/op 31.588 ns/op 0.89
byteArrayEquals 16384 28.433 us/op 19.499 us/op 1.46
Buffer.compare 16384 214.11 ns/op 200.22 ns/op 1.07
byteArrayEquals 123687377 199.12 ms/op 152.94 ms/op 1.30
Buffer.compare 123687377 6.5734 ms/op 4.7287 ms/op 1.39
byteArrayEquals 32 - diff last byte 54.033 ns/op 44.144 ns/op 1.22
Buffer.compare 32 - diff last byte 17.746 ns/op 22.960 ns/op 0.77
byteArrayEquals 1024 - diff last byte 1.6252 us/op 1.2671 us/op 1.28
Buffer.compare 1024 - diff last byte 26.625 ns/op 31.979 ns/op 0.83
byteArrayEquals 16384 - diff last byte 26.064 us/op 20.581 us/op 1.27
Buffer.compare 16384 - diff last byte 194.43 ns/op 203.68 ns/op 0.95
byteArrayEquals 123687377 - diff last byte 194.16 ms/op 151.42 ms/op 1.28
Buffer.compare 123687377 - diff last byte 6.3696 ms/op 5.5690 ms/op 1.14
byteArrayEquals 32 - random bytes 5.3220 ns/op 4.9500 ns/op 1.08
Buffer.compare 32 - random bytes 18.111 ns/op 22.915 ns/op 0.79
byteArrayEquals 1024 - random bytes 5.4340 ns/op 4.9750 ns/op 1.09
Buffer.compare 1024 - random bytes 18.219 ns/op 22.619 ns/op 0.81
byteArrayEquals 16384 - random bytes 5.4340 ns/op 4.9890 ns/op 1.09
Buffer.compare 16384 - random bytes 18.458 ns/op 22.782 ns/op 0.81
byteArrayEquals 123687377 - random bytes 7.4300 ns/op 7.8100 ns/op 0.95
Buffer.compare 123687377 - random bytes 18.970 ns/op 25.730 ns/op 0.74
regular array get 100000 times 34.108 us/op 30.954 us/op 1.10
wrappedArray get 100000 times 34.036 us/op 30.993 us/op 1.10
arrayWithProxy get 100000 times 13.323 ms/op 9.7122 ms/op 1.37
ssz.Root.equals 48.930 ns/op 44.383 ns/op 1.10
byteArrayEquals 47.009 ns/op 45.360 ns/op 1.04
Buffer.compare 10.935 ns/op 12.481 ns/op 0.88
processSlot - 1 slots 10.738 us/op 8.8510 us/op 1.21
processSlot - 32 slots 3.9600 ms/op 1.6490 ms/op 2.40
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.9458 ms/op 2.2321 ms/op 1.32
getCommitteeAssignments - req 1 vs - 250000 vc 2.1041 ms/op 1.8182 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 4.1389 ms/op 3.5980 ms/op 1.15
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4895 ms/op 3.8173 ms/op 1.18
findModifiedValidators - 10000 modified validators 739.72 ms/op 848.54 ms/op 0.87
findModifiedValidators - 1000 modified validators 660.92 ms/op 689.80 ms/op 0.96
findModifiedValidators - 100 modified validators 244.87 ms/op 181.60 ms/op 1.35
findModifiedValidators - 10 modified validators 135.48 ms/op 177.10 ms/op 0.76
findModifiedValidators - 1 modified validators 148.54 ms/op 158.24 ms/op 0.94
findModifiedValidators - no difference 145.21 ms/op 139.82 ms/op 1.04
compare ViewDUs 6.4347 s/op 7.9991 s/op 0.80
compare each validator Uint8Array 1.8806 s/op 1.6304 s/op 1.15
compare ViewDU to Uint8Array 1.0174 s/op 760.89 ms/op 1.34
migrate state 1000000 validators, 24 modified, 0 new 890.88 ms/op 881.99 ms/op 1.01
migrate state 1000000 validators, 1700 modified, 1000 new 1.1889 s/op 1.3668 s/op 0.87
migrate state 1000000 validators, 3400 modified, 2000 new 1.4167 s/op 1.6130 s/op 0.88
migrate state 1500000 validators, 24 modified, 0 new 905.49 ms/op 939.78 ms/op 0.96
migrate state 1500000 validators, 1700 modified, 1000 new 1.1600 s/op 1.0402 s/op 1.12
migrate state 1500000 validators, 3400 modified, 2000 new 1.4877 s/op 1.1828 s/op 1.26
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.9700 ns/op 5.9300 ns/op 0.84
state getBlockRootAtSlot - 250000 vs - 7PWei 526.98 ns/op 460.26 ns/op 1.14
naive computeProposerIndex 100000 validators 73.962 ms/op 41.356 ms/op 1.79
computeProposerIndex 100000 validators 1.7038 ms/op 1.2700 ms/op 1.34
naiveGetNextSyncCommitteeIndices 1000 validators 8.8806 s/op 6.0472 s/op 1.47
getNextSyncCommitteeIndices 1000 validators 127.36 ms/op 102.76 ms/op 1.24
naiveGetNextSyncCommitteeIndices 10000 validators 8.2648 s/op 7.6009 s/op 1.09
getNextSyncCommitteeIndices 10000 validators 133.64 ms/op 120.15 ms/op 1.11
naiveGetNextSyncCommitteeIndices 100000 validators 9.9084 s/op 6.5231 s/op 1.52
getNextSyncCommitteeIndices 100000 validators 149.48 ms/op 101.78 ms/op 1.47
naive computeShuffledIndex 100000 validators 31.063 s/op 22.872 s/op 1.36
cached computeShuffledIndex 100000 validators 593.71 ms/op 480.27 ms/op 1.24
naive computeShuffledIndex 2000000 validators 577.94 s/op 440.67 s/op 1.31
cached computeShuffledIndex 2000000 validators 54.421 s/op 18.621 s/op 2.92
computeProposers - vc 250000 710.26 us/op 525.77 us/op 1.35
computeEpochShuffling - vc 250000 50.596 ms/op 39.747 ms/op 1.27
getNextSyncCommittee - vc 250000 12.501 ms/op 9.2919 ms/op 1.35
computeSigningRoot for AttestationData 33.897 us/op 17.268 us/op 1.96
hash AttestationData serialized data then Buffer.toString(base64) 1.7687 us/op 1.1844 us/op 1.49
toHexString serialized data 1.4981 us/op 1.0173 us/op 1.47
Buffer.toString(base64) 179.66 ns/op 125.10 ns/op 1.44
nodejs block root to RootHex using toHex 158.95 ns/op 122.82 ns/op 1.29
nodejs block root to RootHex using toRootHex 91.793 ns/op 78.113 ns/op 1.18
browser block root to RootHex using the deprecated toHexString 238.06 ns/op 187.88 ns/op 1.27
browser block root to RootHex using toHex 195.29 ns/op 156.96 ns/op 1.24
browser block root to RootHex using toRootHex 170.21 ns/op 147.38 ns/op 1.15

by benchmarkbot/action

for (const attestationGroupByIndexByDataHex of this.attestationGroupByIndexByDataHexBySlot.values()) {
for (const [slot, attestationGroupByIndexByDataHex] of this.attestationGroupByIndexByDataHexBySlot) {
// We have already updated attestationDataCount and attestationCount when looping over `previousSlot`
if (slot === previousSlot) {
Copy link
Contributor

@twoeths twoeths Apr 8, 2025

Choose a reason for hiding this comment

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

this attetationCount and attestationDataCount is not per slot, it's the total value for the whole pool so should not skip it for this slot

Update: nvm, just saw your comment and got the improvement 👍

twoeths
twoeths previously approved these changes Apr 8, 2025
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

@twoeths twoeths merged commit f526cb7 into unstable Apr 8, 2025
19 of 20 checks passed
@twoeths twoeths deleted the nc/improve-agg-att-pool-metric branch April 8, 2025 13:23
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.29.0 🎉

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.

4 participants