-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nbench - Flexible benchmarking of Nimbus internals (#641)
* nbench PoC * Remove the yaml files from the example scenarios * update README with current status * Add an alternative implementation that uses defer * Forgot to add the old proc body * slots-processing * allow benching state_transition failures * Add Attestations processing (workaround confutils bug: - status-im/nim-confutils#10 - status-im/nim-confutils#11 - status-im/nim-confutils#12 * Add CLI command in the readme * Filter report and add notes about CPU cycles * Report averages * Add debugecho style time/cycle print * Report when we skip BLS and state root verification * Update to 0.9.3 * Generalize scenario parsing * Support all block processing scenarios * parallel bench runner PoC * gitBetter load issues reporting (the load issues were invalid signature and expected to fail)
- Loading branch information
Showing
14 changed files
with
809 additions
and
32 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Nimbus-bench | ||
|
||
Nbench is a profiler dedicated to the Nimbus Beacon Chain. | ||
|
||
It is built as a domain specific profiler that aims to be | ||
as unintrusive as possible while providing complementary reports | ||
to dedicated tools like ``perf``, ``Apple Instruments`` or ``Intel Vtune`` | ||
that allows you to dive deep down to a specific line or assembly instructions. | ||
|
||
In particular, those tools cannot tell you that your cryptographic subsystem | ||
or your parsing routines or your random number generation should be revisited, | ||
may sample at to high a resolution (millisecond) instead of per-function statistics, | ||
and are much less useful without debugging symbols which requires a lot of space. | ||
I.e. ``perf`` and other generic profiler tools give you the laser-thin focused pictures | ||
while nbench strives to give you the big picture. | ||
|
||
Features | ||
- by default nbench will collect the number of calls and time spent in | ||
each function. | ||
- like ncli or nfuzz, you can provide nbench isolated scenarios in SSZ format | ||
to analyze Nimbus behaviour. | ||
|
||
## Usage | ||
|
||
``` | ||
nim c -d:const_preset=mainnet -d:nbench -d:release -o:build/nbench nbench/nbench.nim | ||
export SCENARIOS=tests/official/fixtures/tests-v0.9.3/mainnet/phase0 | ||
# Full state transition | ||
build/nbench cmdFullStateTransition -d="${SCENARIOS}"/sanity/blocks/pyspec_tests/voluntary_exit/ -q=2 | ||
# Slot processing | ||
build/nbench cmdSlotProcessing -d="${SCENARIOS}"/sanity/slots/pyspec_tests/slots_1 | ||
# Block header processing | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catBlockHeader -d="${SCENARIOS}"/operations/block_header/pyspec_tests/proposer_slashed/ | ||
# Proposer slashing | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catProposerSlashings -d="${SCENARIOS}"/operations/proposer_slashing/pyspec_tests/invalid_proposer_index/ | ||
# Attester slashing | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catAttesterSlashings -d="${SCENARIOS}"/operations/attester_slashing/pyspec_tests/success_surround/ | ||
# Attestation processing | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catAttestations -d="${SCENARIOS}"/operations/attestation/pyspec_tests/success_multi_proposer_index_iterations/ | ||
# Deposit processing | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catDeposits -d="${SCENARIOS}"/operations/deposit/pyspec_tests/new_deposit_max/ | ||
# Voluntary exit | ||
build/nbench cmdBlockProcessing --blockProcessingCat=catVoluntaryExits -d="${SCENARIOS}"/operations/voluntary_exit/pyspec_tests/validator_exit_in_future/ | ||
``` | ||
|
||
## Running the whole test suite | ||
|
||
Warning: this is a proof-of-concept, there is a slight degree of interleaving in output. | ||
Furthermore benchmarks are run in parallel and might interfere which each other. | ||
|
||
``` | ||
nim c -d:const_preset=mainnet -d:nbench -d:release -o:build/nbench nbench/nbench.nim | ||
nim c -o:build/nbench_tests nbench/nbench_official_fixtures.nim | ||
nbench_tests --nbench=build/nbench --tests=tests/official/fixtures/tests-v0.9.3/mainnet/ | ||
``` | ||
|
||
## TODO Reporting | ||
- Dumping as CSV files also for archival, perf regression suite and/or data mining. | ||
- Piggybacking on eth-metrics and can report over Prometheus or StatsD. | ||
- you can augment it via label pragmas that can be applied file-wide | ||
to tag "cryptography", "block_transition", "database" to have a global view | ||
of the system. |
Oops, something went wrong.