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

Improve processBlock performance tests #2934

Merged
merged 5 commits into from
Aug 10, 2021
Merged

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Aug 10, 2021

Motivation

Our current processBlock performance tests are good but don't cover all operations. We need tests that reflect normal network conditions and then worst cases to ensure we can get through those.

Description

  • Analyze mainnet blocks to understand what's an average block. To recreate just run ts-node packages/beacon-state-transition/test/perf/analyzeBlocks.ts
  • With those results create two performance tests:
    1. an average mainnet block
    2. a worst case block with maxed operations.
  • Add extensive comments explaining the causes of bad performance and how to analyze them

@codeclimate
Copy link

codeclimate bot commented Aug 10, 2021

Code Climate has analyzed commit 4aa80d9 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 001444e Previous: 485ec69 Ratio
getCommitteeAssignments - req 1000 vs - 250000 vc 7.8618 ms/op 9.2282 ms/op 0.85
processBlock altair 250000 vs - 7PWei - maxed ops 450.04 ms/op
processBlock altair 250000 vs - 7PWei - average 159.40 ms/op
epoch altair - 250000 vs - 7PWei - processInactivityUpdates 2.4097 s/op 3.0492 s/op 0.79
epoch altair - 250000 vs - 7PWei - processRewardsAndPenalties 1.0393 s/op 1.2325 s/op 0.84
epoch altair - 250000 vs - 7PWei - processParticipationFlagUpdates 456.04 ms/op 572.53 ms/op 0.80
processBlock phase0 250000 vs - 7PWei - maxed ops 276.62 ms/op
processBlock phase0 250000 vs - 7PWei - average 27.218 ms/op
epoch phase0 - 250000 vs - 7PWei - beforeProcessEpoch 1.7184 s/op 1.8831 s/op 0.91
epoch phase0 - 250000 vs - 7PWei - processRewardsAndPenalties 836.26 ms/op 954.61 ms/op 0.88
epoch phase0 - 250000 vs - 7PWei - processEffectiveBalanceUpdates 105.63 ms/op 188.89 ms/op 0.56
getAttestationDeltas - 250000 vs - 7PWei 133.10 ms/op 136.41 ms/op 0.98
processSlots - 250000 vs - 7PWei - 32 empty slots 3.2985 s/op 3.8874 s/op 0.85
shuffle list - 16384 els 31.296 ms/op 37.375 ms/op 0.84
shuffle list - 250000 els 379.92 ms/op 529.31 ms/op 0.72
getPubkeys - persistent - req 1000 vs - 250000 vc 15.633 us/op 22.626 us/op 0.69
BLS verify - blst-native 1.8584 ms/op 2.3864 ms/op 0.78
BLS verifyMultipleSignatures 3 - blst-native 3.8092 ms/op 4.8731 ms/op 0.78
BLS verifyMultipleSignatures 8 - blst-native 8.2047 ms/op 10.422 ms/op 0.79
BLS verifyMultipleSignatures 32 - blst-native 29.854 ms/op 37.910 ms/op 0.79
BLS aggregatePubkeys 32 - blst-native 41.048 us/op 54.187 us/op 0.76
BLS aggregatePubkeys 128 - blst-native 155.98 us/op 200.91 us/op 0.78
getAttestationsForBlock 84.697 ms/op 146.81 ms/op 0.58
validate gossip signedAggregateAndProof - struct 4.5030 ms/op 7.6318 ms/op 0.59
validate gossip signedAggregateAndProof - treeBacked 4.4719 ms/op 5.9595 ms/op 0.75
validate gossip attestation - struct 2.0982 ms/op 2.7016 ms/op 0.78
validate gossip attestation - treeBacked 2.1307 ms/op 2.8023 ms/op 0.76

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 14422d7 into master Aug 10, 2021
@wemeetagain wemeetagain deleted the dapplion/process-block-perf branch August 10, 2021 17:56
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.

None yet

2 participants