Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the performance tests to use @chainsafe/benchmark #7373

Open
wants to merge 25 commits into
base: unstable
Choose a base branch
from

Conversation

nazarhussain
Copy link
Contributor

Motivation

Use the @chainsafe/benchmark fork for our performance tests. This will enable to run these tests on multiple JS runtimes.

Description

  • Update the packages
  • Update tests files

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner January 17, 2025 15:51
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.22%. Comparing base (06831cf) to head (2213730).
Report is 17 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7373      +/-   ##
============================================
+ Coverage     48.62%   50.22%   +1.60%     
============================================
  Files           603      602       -1     
  Lines         40516    40407     -109     
  Branches       2071     2206     +135     
============================================
+ Hits          19700    20294     +594     
+ Misses        20778    20073     -705     
- Partials         38       40       +2     

Comment on lines +62 to +65

// TODO: Diagnose why this benchmark failing after upgrade
// https://github.com/ChainSafe/lodestar/issues/7380
bench.skip({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only this benchmark is failing, need to troubleshoot in particular later on.

Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

Just a couple small questions but looks good overall

@@ -38,7 +38,7 @@ describe("validate gossip attestation", () => {
state,
bitIndex: i,
});
expect(subnet).to.be.equal(subnet0);
assert.deepEqual(subnet, subnet0);
Copy link
Member

Choose a reason for hiding this comment

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

It seems weird that we need to use assert here...

This reverts commit 8a0e51d.
@nflaig
Copy link
Member

nflaig commented Jan 21, 2025

It would be good to figure out #7380 before merging this

@nflaig
Copy link
Member

nflaig commented Jan 21, 2025

there is no benchmark report / comment on this PR, this is no longer supported or just broken?

@nazarhussain
Copy link
Contributor Author

there is no benchmark report / comment on this PR, this is no longer supported or just broken?

Already looking into it.

@nazarhussain nazarhussain marked this pull request as draft January 21, 2025 15:32
Copy link
Contributor

github-actions bot commented Jan 28, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 7ff78d4 Previous: cf1ecbb Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 965.00 us/op 1.8569 ms/op 0.52
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 34.419 us/op 56.551 us/op 0.61
BLS verify - blst 798.12 us/op 943.71 us/op 0.85
BLS verifyMultipleSignatures 3 - blst 1.2770 ms/op 1.8171 ms/op 0.70
BLS verifyMultipleSignatures 8 - blst 1.6534 ms/op 2.1767 ms/op 0.76
BLS verifyMultipleSignatures 32 - blst 4.9290 ms/op 4.5984 ms/op 1.07
BLS verifyMultipleSignatures 64 - blst 9.0819 ms/op 8.9696 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 17.347 ms/op 16.806 ms/op 1.03
BLS deserializing 10000 signatures 707.33 ms/op 640.05 ms/op 1.11
BLS deserializing 100000 signatures 7.1066 s/op 6.1858 s/op 1.15
BLS verifyMultipleSignatures - same message - 3 - blst 980.69 us/op 926.87 us/op 1.06
BLS verifyMultipleSignatures - same message - 8 - blst 1.0347 ms/op 1.0466 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst 1.7904 ms/op 1.6752 ms/op 1.07
BLS verifyMultipleSignatures - same message - 64 - blst 2.6758 ms/op 2.4333 ms/op 1.10
BLS verifyMultipleSignatures - same message - 128 - blst 4.5286 ms/op 4.0496 ms/op 1.12
BLS aggregatePubkeys 32 - blst 19.634 us/op 17.800 us/op 1.10
BLS aggregatePubkeys 128 - blst 72.164 us/op 61.577 us/op 1.17
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 48.361 ms/op 45.074 ms/op 1.07
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 44.000 ms/op 42.812 ms/op 1.03
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 36.147 ms/op 34.472 ms/op 1.05
getSlashingsAndExits - default max 75.728 us/op 59.931 us/op 1.26
getSlashingsAndExits - 2k 317.21 us/op 292.81 us/op 1.08
proposeBlockBody type=full, size=empty 4.8885 ms/op 4.2669 ms/op 1.15
isKnown best case - 1 super set check 203.00 ns/op 473.00 ns/op 0.43
isKnown normal case - 2 super set checks 195.00 ns/op 581.00 ns/op 0.34
isKnown worse case - 16 super set checks 193.00 ns/op 486.00 ns/op 0.40
InMemoryCheckpointStateCache - add get delete 2.4240 us/op 3.8730 us/op 0.63
validate api signedAggregateAndProof - struct 1.4246 ms/op 1.6549 ms/op 0.86
validate gossip signedAggregateAndProof - struct 1.4501 ms/op 1.7755 ms/op 0.82
batch validate gossip attestation - vc 640000 - chunk 32 122.42 us/op 134.76 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 64 104.62 us/op 124.95 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 128 95.919 us/op 97.665 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 101.14 us/op 95.329 us/op 1.06
pickEth1Vote - no votes 956.89 us/op 831.27 us/op 1.15
pickEth1Vote - max votes 5.2793 ms/op 4.8511 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.245 ms/op 12.073 ms/op 0.93
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.570 ms/op 17.432 ms/op 0.95
pickEth1Vote - Eth1Data fastSerialize value x2048 440.19 us/op 385.61 us/op 1.14
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.9292 ms/op 2.5464 ms/op 1.94
bytes32 toHexString 371.00 ns/op 595.00 ns/op 0.62
bytes32 Buffer.toString(hex) 253.00 ns/op 438.00 ns/op 0.58
bytes32 Buffer.toString(hex) from Uint8Array 339.00 ns/op 551.00 ns/op 0.62
bytes32 Buffer.toString(hex) + 0x 253.00 ns/op 452.00 ns/op 0.56
Object access 1 prop 0.11600 ns/op 0.31000 ns/op 0.37
Map access 1 prop 0.12000 ns/op 0.30600 ns/op 0.39
Object get x1000 5.7470 ns/op 4.8900 ns/op 1.18
Map get x1000 6.3640 ns/op 5.6430 ns/op 1.13
Object set x1000 29.135 ns/op 22.740 ns/op 1.28
Map set x1000 20.155 ns/op 18.587 ns/op 1.08
Return object 10000 times 0.28810 ns/op 0.28760 ns/op 1.00
Throw Error 10000 times 4.3730 us/op 2.5863 us/op 1.69
toHex 135.69 ns/op 102.21 ns/op 1.33
Buffer.from 119.37 ns/op 98.704 ns/op 1.21
shared Buffer 80.487 ns/op 71.244 ns/op 1.13
fastMsgIdFn sha256 / 200 bytes 2.1870 us/op 2.0310 us/op 1.08
fastMsgIdFn h32 xxhash / 200 bytes 204.00 ns/op 414.00 ns/op 0.49
fastMsgIdFn h64 xxhash / 200 bytes 261.00 ns/op 452.00 ns/op 0.58
fastMsgIdFn sha256 / 1000 bytes 7.0510 us/op 6.0020 us/op 1.17
fastMsgIdFn h32 xxhash / 1000 bytes 333.00 ns/op 514.00 ns/op 0.65
fastMsgIdFn h64 xxhash / 1000 bytes 337.00 ns/op 508.00 ns/op 0.66
fastMsgIdFn sha256 / 10000 bytes 64.866 us/op 49.370 us/op 1.31
fastMsgIdFn h32 xxhash / 10000 bytes 1.8490 us/op 1.8820 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2250 us/op 1.3140 us/op 0.93
send data - 1000 256B messages 13.833 ms/op 10.786 ms/op 1.28
send data - 1000 512B messages 17.298 ms/op 13.594 ms/op 1.27
send data - 1000 1024B messages 26.708 ms/op 20.534 ms/op 1.30
send data - 1000 1200B messages 19.881 ms/op 23.320 ms/op 0.85
send data - 1000 2048B messages 21.814 ms/op 30.276 ms/op 0.72
send data - 1000 4096B messages 26.943 ms/op 29.406 ms/op 0.92
send data - 1000 16384B messages 55.825 ms/op 67.582 ms/op 0.83
send data - 1000 65536B messages 216.34 ms/op 258.09 ms/op 0.84
enrSubnets - fastDeserialize 64 bits 892.00 ns/op 1.1610 us/op 0.77
enrSubnets - ssz BitVector 64 bits 343.00 ns/op 529.00 ns/op 0.65
enrSubnets - fastDeserialize 4 bits 132.00 ns/op 337.00 ns/op 0.39
enrSubnets - ssz BitVector 4 bits 351.00 ns/op 527.00 ns/op 0.67
prioritizePeers score -10:0 att 32-0.1 sync 2-0 180.67 us/op 110.25 us/op 1.64
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 221.22 us/op 136.12 us/op 1.63
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 298.92 us/op 194.87 us/op 1.53
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 497.33 us/op 341.13 us/op 1.46
prioritizePeers score 0:0 att 64-1 sync 4-1 555.18 us/op 418.13 us/op 1.33
array of 16000 items push then shift 1.6948 us/op 1.3434 us/op 1.26
LinkedList of 16000 items push then shift 7.8980 ns/op 7.6730 ns/op 1.03
array of 16000 items push then pop 81.694 ns/op 111.33 ns/op 0.73
LinkedList of 16000 items push then pop 7.4280 ns/op 6.3680 ns/op 1.17
array of 24000 items push then shift 2.4606 us/op 1.8395 us/op 1.34
LinkedList of 24000 items push then shift 12.731 ns/op 7.4040 ns/op 1.72
array of 24000 items push then pop 128.04 ns/op 139.85 ns/op 0.92
LinkedList of 24000 items push then pop 19.823 ns/op 6.1600 ns/op 3.22
intersect bitArray bitLen 8 17.954 ns/op 5.3880 ns/op 3.33
intersect array and set length 8 61.297 ns/op 37.528 ns/op 1.63
intersect bitArray bitLen 128 51.524 ns/op 27.594 ns/op 1.87
intersect array and set length 128 955.45 ns/op 575.75 ns/op 1.66
bitArray.getTrueBitIndexes() bitLen 128 1.4550 us/op 1.4140 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 248 2.5030 us/op 2.3400 us/op 1.07
bitArray.getTrueBitIndexes() bitLen 512 6.8690 us/op 4.6270 us/op 1.48
Buffer.concat 32 items 1.1500 us/op 918.00 ns/op 1.25
Uint8Array.set 32 items 2.9710 us/op 1.6160 us/op 1.84
Buffer.copy 5.4440 us/op 2.4950 us/op 2.18
Uint8Array.set - with subarray 5.4980 us/op 2.1370 us/op 2.57
Uint8Array.set - without subarray 1.9520 us/op 1.4420 us/op 1.35
getUint32 - dataview 223.00 ns/op 392.00 ns/op 0.57
getUint32 - manual 200.00 ns/op 324.00 ns/op 0.62
Set add up to 64 items then delete first 3.5383 us/op 1.7906 us/op 1.98
OrderedSet add up to 64 items then delete first 5.6443 us/op 2.7749 us/op 2.03
Set add up to 64 items then delete last 4.1145 us/op 2.0405 us/op 2.02
OrderedSet add up to 64 items then delete last 6.3408 us/op 3.2030 us/op 1.98
Set add up to 64 items then delete middle 5.8734 us/op 2.0640 us/op 2.85
OrderedSet add up to 64 items then delete middle 12.446 us/op 4.6397 us/op 2.68
Set add up to 128 items then delete first 8.5213 us/op 3.9606 us/op 2.15
OrderedSet add up to 128 items then delete first 13.752 us/op 5.9708 us/op 2.30
Set add up to 128 items then delete last 11.801 us/op 3.9542 us/op 2.98
OrderedSet add up to 128 items then delete last 12.572 us/op 6.2272 us/op 2.02
Set add up to 128 items then delete middle 6.7893 us/op 4.1339 us/op 1.64
OrderedSet add up to 128 items then delete middle 18.581 us/op 11.746 us/op 1.58
Set add up to 256 items then delete first 21.767 us/op 7.4899 us/op 2.91
OrderedSet add up to 256 items then delete first 26.701 us/op 11.484 us/op 2.32
Set add up to 256 items then delete last 15.362 us/op 7.4687 us/op 2.06
OrderedSet add up to 256 items then delete last 21.611 us/op 11.831 us/op 1.83
Set add up to 256 items then delete middle 14.651 us/op 7.3627 us/op 1.99
OrderedSet add up to 256 items then delete middle 86.826 us/op 34.095 us/op 2.55
transfer serialized Status (84 B) 3.9110 us/op 2.1480 us/op 1.82
copy serialized Status (84 B) 2.9530 us/op 1.3430 us/op 2.20
transfer serialized SignedVoluntaryExit (112 B) 3.4550 us/op 2.2310 us/op 1.55
copy serialized SignedVoluntaryExit (112 B) 3.3180 us/op 1.3510 us/op 2.46
transfer serialized ProposerSlashing (416 B) 5.4580 us/op 2.9490 us/op 1.85
copy serialized ProposerSlashing (416 B) 3.5600 us/op 2.4350 us/op 1.46
transfer serialized Attestation (485 B) 3.6970 us/op 3.0970 us/op 1.19
copy serialized Attestation (485 B) 2.9730 us/op 2.0530 us/op 1.45
transfer serialized AttesterSlashing (33232 B) 4.0240 us/op 2.7730 us/op 1.45
copy serialized AttesterSlashing (33232 B) 6.7150 us/op 5.7390 us/op 1.17
transfer serialized Small SignedBeaconBlock (128000 B) 4.0530 us/op 3.2580 us/op 1.24
copy serialized Small SignedBeaconBlock (128000 B) 17.674 us/op 18.107 us/op 0.98
transfer serialized Avg SignedBeaconBlock (200000 B) 4.7180 us/op 3.3930 us/op 1.39
copy serialized Avg SignedBeaconBlock (200000 B) 26.253 us/op 22.591 us/op 1.16
transfer serialized BlobsSidecar (524380 B) 5.7140 us/op 4.3270 us/op 1.32
copy serialized BlobsSidecar (524380 B) 86.636 us/op 118.58 us/op 0.73
transfer serialized Big SignedBeaconBlock (1000000 B) 5.6740 us/op 4.7920 us/op 1.18
copy serialized Big SignedBeaconBlock (1000000 B) 144.75 us/op 135.30 us/op 1.07
pass gossip attestations to forkchoice per slot 3.1301 ms/op 2.7213 ms/op 1.15
forkChoice updateHead vc 100000 bc 64 eq 0 505.25 us/op 364.73 us/op 1.39
forkChoice updateHead vc 600000 bc 64 eq 0 6.5298 ms/op 2.3231 ms/op 2.81
forkChoice updateHead vc 1000000 bc 64 eq 0 6.8432 ms/op 4.0518 ms/op 1.69
forkChoice updateHead vc 600000 bc 320 eq 0 3.8390 ms/op 2.1802 ms/op 1.76
forkChoice updateHead vc 600000 bc 1200 eq 0 3.1505 ms/op 2.2110 ms/op 1.42
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2382 ms/op 2.4322 ms/op 1.33
forkChoice updateHead vc 600000 bc 64 eq 1000 10.976 ms/op 9.1855 ms/op 1.19
forkChoice updateHead vc 600000 bc 64 eq 10000 10.802 ms/op 9.5316 ms/op 1.13
forkChoice updateHead vc 600000 bc 64 eq 300000 13.862 ms/op 11.544 ms/op 1.20
computeDeltas 500000 validators 300 proto nodes 4.0670 ms/op 3.4659 ms/op 1.17
computeDeltas 500000 validators 1200 proto nodes 4.0667 ms/op 3.3417 ms/op 1.22
computeDeltas 500000 validators 7200 proto nodes 4.0759 ms/op 3.3150 ms/op 1.23
computeDeltas 750000 validators 300 proto nodes 5.9837 ms/op 5.1554 ms/op 1.16
computeDeltas 750000 validators 1200 proto nodes 5.9416 ms/op 5.0939 ms/op 1.17
computeDeltas 750000 validators 7200 proto nodes 5.9214 ms/op 4.8762 ms/op 1.21
computeDeltas 1400000 validators 300 proto nodes 11.238 ms/op 9.4376 ms/op 1.19
computeDeltas 1400000 validators 1200 proto nodes 11.060 ms/op 10.218 ms/op 1.08
computeDeltas 1400000 validators 7200 proto nodes 11.227 ms/op 9.3616 ms/op 1.20
computeDeltas 2100000 validators 300 proto nodes 27.835 ms/op 14.346 ms/op 1.94
computeDeltas 2100000 validators 1200 proto nodes 25.265 ms/op 14.251 ms/op 1.77
computeDeltas 2100000 validators 7200 proto nodes 16.770 ms/op 14.728 ms/op 1.14
altair processAttestation - 250000 vs - 7PWei normalcase 3.4784 ms/op 1.6138 ms/op 2.16
altair processAttestation - 250000 vs - 7PWei worstcase 3.0835 ms/op 2.3618 ms/op 1.31
altair processAttestation - setStatus - 1/6 committees join 129.73 us/op 91.516 us/op 1.42
altair processAttestation - setStatus - 1/3 committees join 246.86 us/op 176.28 us/op 1.40
altair processAttestation - setStatus - 1/2 committees join 339.30 us/op 269.06 us/op 1.26
altair processAttestation - setStatus - 2/3 committees join 435.59 us/op 351.36 us/op 1.24
altair processAttestation - setStatus - 4/5 committees join 600.48 us/op 480.18 us/op 1.25
altair processAttestation - setStatus - 100% committees join 705.94 us/op 568.95 us/op 1.24
altair processBlock - 250000 vs - 7PWei normalcase 4.3899 ms/op 4.5298 ms/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.995 ms/op 25.102 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase 34.646 ms/op 35.949 ms/op 0.96
altair processBlock - 250000 vs - 7PWei worstcase hashState 74.168 ms/op 80.458 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5186 ms/op 1.8235 ms/op 0.83
phase0 processBlock - 250000 vs - 7PWei worstcase 20.572 ms/op 22.157 ms/op 0.93
altair processEth1Data - 250000 vs - 7PWei normalcase 320.69 us/op 326.53 us/op 0.98
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.6340 us/op 5.0570 us/op 0.92
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 25.621 us/op 24.872 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 7.5340 us/op 7.2510 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 4.7540 us/op 4.8320 us/op 0.98
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 110.61 us/op 104.34 us/op 1.06
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 931.32 us/op 1.1739 ms/op 0.79
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.3441 ms/op 1.0111 ms/op 1.33
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3362 ms/op 965.95 us/op 1.38
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.4630 ms/op 2.7922 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3985 ms/op 1.0929 ms/op 1.28
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.5111 ms/op 2.6612 ms/op 1.32
Tree 40 250000 create 395.45 ms/op 364.74 ms/op 1.08
Tree 40 250000 get(125000) 139.26 ns/op 120.02 ns/op 1.16
Tree 40 250000 set(125000) 1.4316 us/op 1.4350 us/op 1.00
Tree 40 250000 toArray() 15.310 ms/op 10.131 ms/op 1.51
Tree 40 250000 iterate all - toArray() + loop 15.338 ms/op 9.2685 ms/op 1.65
Tree 40 250000 iterate all - get(i) 49.646 ms/op 40.192 ms/op 1.24
Array 250000 create 2.4303 ms/op 2.3125 ms/op 1.05
Array 250000 clone - spread 815.92 us/op 1.1527 ms/op 0.71
Array 250000 get(125000) 0.40700 ns/op 0.59100 ns/op 0.69
Array 250000 set(125000) 0.43200 ns/op 0.61400 ns/op 0.70
Array 250000 iterate all - loop 82.893 us/op 77.564 us/op 1.07
phase0 afterProcessEpoch - 250000 vs - 7PWei 48.919 ms/op 41.767 ms/op 1.17
Array.fill - length 1000000 3.5218 ms/op 2.5010 ms/op 1.41
Array push - length 1000000 12.752 ms/op 15.827 ms/op 0.81
Array.get 0.27207 ns/op 0.25054 ns/op 1.09
Uint8Array.get 0.43524 ns/op 0.34321 ns/op 1.27
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.084 ms/op 12.737 ms/op 1.42
altair processEpoch - mainnet_e81889 245.55 ms/op 260.69 ms/op 0.94
mainnet_e81889 - altair beforeProcessEpoch 20.287 ms/op 15.838 ms/op 1.28
mainnet_e81889 - altair processJustificationAndFinalization 5.1620 us/op 11.485 us/op 0.45
mainnet_e81889 - altair processInactivityUpdates 3.9492 ms/op 3.5802 ms/op 1.10
mainnet_e81889 - altair processRewardsAndPenalties 37.204 ms/op 50.535 ms/op 0.74
mainnet_e81889 - altair processRegistryUpdates 693.00 ns/op 2.0820 us/op 0.33
mainnet_e81889 - altair processSlashings 174.00 ns/op 808.00 ns/op 0.22
mainnet_e81889 - altair processEth1DataReset 172.00 ns/op 841.00 ns/op 0.20
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2341 ms/op 1.6486 ms/op 0.75
mainnet_e81889 - altair processSlashingsReset 851.00 ns/op 2.7850 us/op 0.31
mainnet_e81889 - altair processRandaoMixesReset 1.1030 us/op 3.1040 us/op 0.36
mainnet_e81889 - altair processHistoricalRootsUpdate 177.00 ns/op 1.6660 us/op 0.11
mainnet_e81889 - altair processParticipationFlagUpdates 517.00 ns/op 1.8970 us/op 0.27
mainnet_e81889 - altair processSyncCommitteeUpdates 136.00 ns/op 932.00 ns/op 0.15
mainnet_e81889 - altair afterProcessEpoch 51.834 ms/op 43.413 ms/op 1.19
capella processEpoch - mainnet_e217614 816.79 ms/op 1.0159 s/op 0.80
mainnet_e217614 - capella beforeProcessEpoch 62.021 ms/op 67.533 ms/op 0.92
mainnet_e217614 - capella processJustificationAndFinalization 5.1320 us/op 12.069 us/op 0.43
mainnet_e217614 - capella processInactivityUpdates 15.737 ms/op 12.095 ms/op 1.30
mainnet_e217614 - capella processRewardsAndPenalties 166.08 ms/op 207.41 ms/op 0.80
mainnet_e217614 - capella processRegistryUpdates 6.3620 us/op 12.105 us/op 0.53
mainnet_e217614 - capella processSlashings 175.00 ns/op 1.0840 us/op 0.16
mainnet_e217614 - capella processEth1DataReset 176.00 ns/op 982.00 ns/op 0.18
mainnet_e217614 - capella processEffectiveBalanceUpdates 10.252 ms/op 14.846 ms/op 0.69
mainnet_e217614 - capella processSlashingsReset 848.00 ns/op 2.7430 us/op 0.31
mainnet_e217614 - capella processRandaoMixesReset 1.1250 us/op 3.9140 us/op 0.29
mainnet_e217614 - capella processHistoricalRootsUpdate 176.00 ns/op 820.00 ns/op 0.21
mainnet_e217614 - capella processParticipationFlagUpdates 527.00 ns/op 2.0100 us/op 0.26
mainnet_e217614 - capella afterProcessEpoch 124.94 ms/op 103.36 ms/op 1.21
phase0 processEpoch - mainnet_e58758 257.09 ms/op 317.94 ms/op 0.81
mainnet_e58758 - phase0 beforeProcessEpoch 64.803 ms/op 75.826 ms/op 0.85
mainnet_e58758 - phase0 processJustificationAndFinalization 5.6440 us/op 12.934 us/op 0.44
mainnet_e58758 - phase0 processRewardsAndPenalties 34.031 ms/op 22.438 ms/op 1.52
mainnet_e58758 - phase0 processRegistryUpdates 3.0760 us/op 3.9970 us/op 0.77
mainnet_e58758 - phase0 processSlashings 177.00 ns/op 854.00 ns/op 0.21
mainnet_e58758 - phase0 processEth1DataReset 174.00 ns/op 862.00 ns/op 0.20
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0207 ms/op 836.89 us/op 1.22
mainnet_e58758 - phase0 processSlashingsReset 898.00 ns/op 7.0410 us/op 0.13
mainnet_e58758 - phase0 processRandaoMixesReset 1.1730 us/op 3.8470 us/op 0.30
mainnet_e58758 - phase0 processHistoricalRootsUpdate 178.00 ns/op 920.00 ns/op 0.19
mainnet_e58758 - phase0 processParticipationRecordUpdates 845.00 ns/op 4.4430 us/op 0.19
mainnet_e58758 - phase0 afterProcessEpoch 42.078 ms/op 36.147 ms/op 1.16
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3646 ms/op 987.70 us/op 1.38
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9222 ms/op 1.5442 ms/op 1.24
altair processInactivityUpdates - 250000 normalcase 16.100 ms/op 16.203 ms/op 0.99
altair processInactivityUpdates - 250000 worstcase 16.452 ms/op 18.442 ms/op 0.89
phase0 processRegistryUpdates - 250000 normalcase 6.5190 us/op 5.5560 us/op 1.17
phase0 processRegistryUpdates - 250000 badcase_full_deposits 231.29 us/op 276.10 us/op 0.84
phase0 processRegistryUpdates - 250000 worstcase 0.5 96.108 ms/op 93.215 ms/op 1.03
altair processRewardsAndPenalties - 250000 normalcase 42.613 ms/op 38.665 ms/op 1.10
altair processRewardsAndPenalties - 250000 worstcase 42.678 ms/op 23.135 ms/op 1.84
phase0 getAttestationDeltas - 250000 normalcase 7.1442 ms/op 6.6700 ms/op 1.07
phase0 getAttestationDeltas - 250000 worstcase 6.7699 ms/op 5.8846 ms/op 1.15
phase0 processSlashings - 250000 worstcase 83.589 us/op 87.492 us/op 0.96
altair processSyncCommitteeUpdates - 250000 117.77 ms/op 96.082 ms/op 1.23
BeaconState.hashTreeRoot - No change 207.00 ns/op 465.00 ns/op 0.45
BeaconState.hashTreeRoot - 1 full validator 83.594 us/op 103.66 us/op 0.81
BeaconState.hashTreeRoot - 32 full validator 881.18 us/op 834.80 us/op 1.06
BeaconState.hashTreeRoot - 512 full validator 8.6057 ms/op 7.0076 ms/op 1.23
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 86.659 us/op 85.541 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2051 ms/op 1.2263 ms/op 0.98
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.318 ms/op 15.126 ms/op 1.14
BeaconState.hashTreeRoot - 1 balances 74.736 us/op 68.763 us/op 1.09
BeaconState.hashTreeRoot - 32 balances 859.57 us/op 641.98 us/op 1.34
BeaconState.hashTreeRoot - 512 balances 6.7572 ms/op 7.0515 ms/op 0.96
BeaconState.hashTreeRoot - 250000 balances 146.31 ms/op 169.97 ms/op 0.86
aggregationBits - 2048 els - zipIndexesInBitList 21.523 us/op 22.440 us/op 0.96
byteArrayEquals 32 53.818 ns/op 47.965 ns/op 1.12
Buffer.compare 32 17.233 ns/op 15.735 ns/op 1.10
byteArrayEquals 1024 1.5866 us/op 1.2722 us/op 1.25
Buffer.compare 1024 25.412 ns/op 24.194 ns/op 1.05
byteArrayEquals 16384 25.329 us/op 20.221 us/op 1.25
Buffer.compare 16384 199.13 ns/op 207.74 ns/op 0.96
byteArrayEquals 123687377 193.48 ms/op 151.54 ms/op 1.28
Buffer.compare 123687377 6.5985 ms/op 4.4665 ms/op 1.48
byteArrayEquals 32 - diff last byte 53.244 ns/op 48.141 ns/op 1.11
Buffer.compare 32 - diff last byte 17.227 ns/op 16.022 ns/op 1.08
byteArrayEquals 1024 - diff last byte 1.6179 us/op 1.2861 us/op 1.26
Buffer.compare 1024 - diff last byte 25.187 ns/op 23.896 ns/op 1.05
byteArrayEquals 16384 - diff last byte 25.760 us/op 20.330 us/op 1.27
Buffer.compare 16384 - diff last byte 189.99 ns/op 190.31 ns/op 1.00
byteArrayEquals 123687377 - diff last byte 194.43 ms/op 148.67 ms/op 1.31
Buffer.compare 123687377 - diff last byte 6.8176 ms/op 5.6249 ms/op 1.21
byteArrayEquals 32 - random bytes 5.1610 ns/op 5.0880 ns/op 1.01
Buffer.compare 32 - random bytes 18.574 ns/op 15.826 ns/op 1.17
byteArrayEquals 1024 - random bytes 5.1680 ns/op 4.9970 ns/op 1.03
Buffer.compare 1024 - random bytes 17.656 ns/op 15.635 ns/op 1.13
byteArrayEquals 16384 - random bytes 5.1160 ns/op 4.7630 ns/op 1.07
Buffer.compare 16384 - random bytes 17.490 ns/op 14.808 ns/op 1.18
byteArrayEquals 123687377 - random bytes 6.3400 ns/op 7.5100 ns/op 0.84
Buffer.compare 123687377 - random bytes 18.620 ns/op 17.680 ns/op 1.05
regular array get 100000 times 33.387 us/op 30.114 us/op 1.11
wrappedArray get 100000 times 33.157 us/op 29.603 us/op 1.12
arrayWithProxy get 100000 times 15.307 ms/op 9.4881 ms/op 1.61
ssz.Root.equals 46.186 ns/op 41.520 ns/op 1.11
byteArrayEquals 45.301 ns/op 37.351 ns/op 1.21
Buffer.compare 10.304 ns/op 8.6740 ns/op 1.19
processSlot - 1 slots 10.315 us/op 13.172 us/op 0.78
processSlot - 32 slots 2.2793 ms/op 2.5606 ms/op 0.89
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 51.168 ms/op 39.141 ms/op 1.31
getCommitteeAssignments - req 1 vs - 250000 vc 2.1470 ms/op 1.8771 ms/op 1.14
getCommitteeAssignments - req 100 vs - 250000 vc 4.1700 ms/op 3.6354 ms/op 1.15
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4135 ms/op 3.8592 ms/op 1.14
compare ViewDUs 6.1043 s/op 3.0378 s/op 2.01
compare each validator Uint8Array 1.3711 s/op 1.3011 s/op 1.05
compare ViewDU to Uint8Array 1.0793 s/op 781.36 ms/op 1.38
migrate state 1000000 validators, 24 modified, 0 new 934.68 ms/op 581.74 ms/op 1.61
migrate state 1000000 validators, 1700 modified, 1000 new 1.2383 s/op 921.62 ms/op 1.34
migrate state 1000000 validators, 3400 modified, 2000 new 1.1717 s/op 1.1343 s/op 1.03
migrate state 1500000 validators, 24 modified, 0 new 863.38 ms/op 701.63 ms/op 1.23
migrate state 1500000 validators, 1700 modified, 1000 new 1.0865 s/op 960.06 ms/op 1.13
migrate state 1500000 validators, 3400 modified, 2000 new 1.3096 s/op 992.35 ms/op 1.32
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3000 ns/op 6.2700 ns/op 0.69
state getBlockRootAtSlot - 250000 vs - 7PWei 435.60 ns/op 679.46 ns/op 0.64
computeProposers - vc 250000 6.3538 ms/op 6.4625 ms/op 0.98
computeEpochShuffling - vc 250000 42.706 ms/op 35.343 ms/op 1.21
getNextSyncCommittee - vc 250000 136.13 ms/op 109.13 ms/op 1.25
computeSigningRoot for AttestationData 19.181 us/op 24.347 us/op 0.79
hash AttestationData serialized data then Buffer.toString(base64) 1.5521 us/op 1.1822 us/op 1.31
toHexString serialized data 1.1139 us/op 780.63 ns/op 1.43
Buffer.toString(base64) 152.53 ns/op 133.26 ns/op 1.14
nodejs block root to RootHex using toHex 147.47 ns/op 114.12 ns/op 1.29
nodejs block root to RootHex using toRootHex 90.111 ns/op 74.747 ns/op 1.21
browser block root to RootHex using the deprecated toHexString 214.14 ns/op 205.57 ns/op 1.04
browser block root to RootHex using toHex 173.50 ns/op 164.24 ns/op 1.06
browser block root to RootHex using toRootHex 160.67 ns/op 146.19 ns/op 1.10

by benchmarkbot/action

@nazarhussain nazarhussain marked this pull request as ready for review January 29, 2025 22:27

// TODO: Diagnose why this benchmark failing after upgrade
// https://github.com/ChainSafe/lodestar/issues/7380
bench.skip({
Copy link
Member

Choose a reason for hiding this comment

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

would be good to see this addressed before merging

minRuns: 10
# Default is set to 0.005, which is too low considering the benchmark setup we have
# Changing it to 0.05 which is 5/100, so 5% difference of moving average among run times
convergeFactor: 0.075 # 7.5 / 100
Copy link
Member

Choose a reason for hiding this comment

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

how did you come up with this number? we should probably test if this is still low enough to catch actual regressions

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