prysm-pulse/beacon-chain/core/state/benchmarks
Raul Jordan 0326be86b5 Apply Patch Rules to Use EthereumAPIs Generated Protos in Prysm (#4112)
* starting on patch
* finish determining all required patches
* properly redefine the patch rules
* new patch
* rem double semicolon
* fix patch file
* Merge branch 'master' of github.com:prysmaticlabs/prysm into deprecate-eth-protos
* building the deps
* test target passes using ethereumapis
* compile gateway
* attempting to build everything
* e2e use ethereumapis
* more fixes for slasher
* other item
* getting closer to compiling slasher
* build slasher package
* Merge branch 'master' into deprecate-eth-protos
* Merge branch 'master' into deprecate-eth-protos
* fix benches
* lint gazelle
* Merge branch 'deprecate-eth-protos' of github.com:prysmaticlabs/prysm into deprecate-eth-protos
* proper gateway
* lint
* Merge branch 'master' into deprecate-eth-protos
* fix build
* Merge branch 'deprecate-eth-protos' of github.com:prysmaticlabs/prysm into deprecate-eth-protos
* use swag
* resolve
* ignore change
* include new patch changes
* fix test
* builds
* fix e2e
* gaz
2019-11-27 05:08:18 +00:00
..
benchmark_files Apply Patch Rules to Use EthereumAPIs Generated Protos in Prysm (#4112) 2019-11-27 05:08:18 +00:00
benchmarks_test.go Apply Patch Rules to Use EthereumAPIs Generated Protos in Prysm (#4112) 2019-11-27 05:08:18 +00:00
BUILD.bazel Apply Patch Rules to Use EthereumAPIs Generated Protos in Prysm (#4112) 2019-11-27 05:08:18 +00:00
config.go Create Benchmarks Package for State Transition (#3688) 2019-11-26 18:09:57 +00:00
README.md Create Benchmarks Package for State Transition (#3688) 2019-11-26 18:09:57 +00:00

Benchmarks for Prysm State Transition

This package contains the functionality needed for benchmarking Prysms state transitions, this includes its block processing (with and without caching) and epoch processing functions. There is also a benchmark for HashTreeRoot on a large beacon state.

Benchmark Configuration

The following configs are in config.go:

  • ValidatorCount: Sets the amount of active validators to perform the benchmarks with. Default is 65536.
  • AttestationsPerEpoch: Sets the amount of attestations per epoch for the benchmarks to perform with, this affects the amount of attestations in a full block and the amount of attestations per epoch in the state for the ProcessEpoch and HashTreeRoot benchmark. Default is 128.

Generating new SSZ files

Due to the sheer size of the benchmarking configurations (65536 validators), the files used for benchmarking are pregenerated so there's no wasted computations on generating a genesis state with 65536 validators. This should only be needed if there is a breaking spec change and the tests fail from SSZ issues.

To generate new files to use for benchmarking, run the below command in the root of Prysm.

go run beacon-chain/core/state/benchmarks/benchmark_files/generate_bench_files.go

Bazel does not allow writing to the project directory, so running with go run is needed.

Current Results as of November 2019

BenchmarkExecuteStateTransition-4   	         25	35901941409 ns/op	7465058127 B/op	111046635 allocs/op
BenchmarkExecuteStateTransition_WithCache-4    25	24352836461 ns/op	716078697 B/op	22348530 allocs/op
BenchmarkProcessEpoch_2FullEpochs-4   	       5	177559078808 ns/op	12754314974 B/op	176571470 allocs/op
BenchmarkHashTreeRoot_FullState-4   	         50	1321382095 ns/op	253959577 B/op	 9645648 allocs/op