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

performance: block validation benchmark #4522

Merged
merged 22 commits into from
Sep 19, 2022

Conversation

algonautshant
Copy link
Contributor

@algonautshant algonautshant commented Sep 9, 2022

Block validation benchmark
resolves https://github.com/algorand/go-algorand-internal/issues/2259

$ go test -run none -v -bench BenchmarkBlockValidation -timeout=500000s -benchtime=10x

ld: warning: -no_pie is deprecated when targeting new OS versions
goos: darwin
goarch: amd64
pkg: github.com/algorand/go-algorand/ledger
cpu: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz

BenchmarkBlockValidationJustPayNoNew
Preparing... /1: 100% 1.7s
Summary 1 blocks and 27026 txns: pay 27026/blk (100%) assets 0/blk (0%) apps 0/blk (0%)
1.1 sec / 1 blks
Preparing... /10: 20% 3.4s 40% 3.4s 60% 3.4s 80% 3.3s 100% 3.4s
Summary 10 blocks and 265337 txns: pay 26533/blk (100%) assets 0/blk (0%) apps 0/blk (0%)
11.0 sec / 10 blks

BenchmarkBlockValidationJustPayNoNew-8 10 1099660242 ns/op

BenchmarkBlockValidationJustPay
Preparing... /1: 100% 2.2s
Summary 1 blocks and 26752 txns: pay 26752/blk (100%) assets 0/blk (0%) apps 0/blk (0%)
1.5 sec / 1 blks
Preparing... /10: 20% 4.3s 40% 4.3s 60% 4.2s 80% 4.4s 100% 4.7s
Summary 10 blocks and 262667 txns: pay 26266/blk (100%) assets 0/blk (0%) apps 0/blk (0%)
14.8 sec / 10 blks

BenchmarkBlockValidationJustPay-8 10 1479483790 ns/op

BenchmarkBlockValidationNoNew
Preparing... /1: 100% 3.2s
Summary 1 blocks and 24581 txns: pay 2930/blk (11%) assets 15453/blk (62%) apps 6198/blk (25%)
2.1 sec / 1 blks
Preparing... /10: 20% 6.0s 40% 5.4s 60% 5.8s 80% 5.4s 100% 6.0s
Summary 10 blocks and 239915 txns: pay 3254/blk (13%) assets 14224/blk (59%) apps 6512/blk (27%)
22.7 sec / 10 blks

BenchmarkBlockValidationNoNew-8 10 2266421693 ns/op

BenchmarkBlockValidationMix
Preparing... /1: 100% 2.8s
Summary 1 blocks and 24773 txns: pay 5905/blk (23%) assets 13339/blk (53%) apps 5529/blk (22%)
2.4 sec / 1 blks
Preparing... /10: 20% 5.4s 40% 6.0s 60% 5.2s 80% 5.6s 100% 6.3s
Summary 10 blocks and 242232 txns: pay 5955/blk (24%) assets 12737/blk (52%) apps 5530/blk (22%)
23.4 sec / 10 blks
BenchmarkBlockValidationMix-8 10 2343313013 ns/op
PASS
ok github.com/algorand/go-algorand/ledger 245.240s

@algonautshant algonautshant changed the title Block validation benchmark WIP: Block validation benchmark Sep 9, 2022
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Merging #4522 (66a992b) into master (00b37f2) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4522      +/-   ##
==========================================
- Coverage   55.28%   55.23%   -0.06%     
==========================================
  Files         398      398              
  Lines       50336    50336              
==========================================
- Hits        27829    27801      -28     
- Misses      20178    20203      +25     
- Partials     2329     2332       +3     
Impacted Files Coverage Δ
util/db/dbutil.go 44.24% <0.00%> (-4.25%) ⬇️
ledger/blockqueue.go 85.63% <0.00%> (-2.88%) ⬇️
ledger/tracker.go 72.76% <0.00%> (-2.13%) ⬇️
agreement/cryptoVerifier.go 67.60% <0.00%> (-2.12%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
catchup/service.go 68.14% <0.00%> (-1.24%) ⬇️
ledger/acctupdates.go 69.59% <0.00%> (-0.60%) ⬇️
network/wsNetwork.go 64.63% <0.00%> (ø)
ledger/roundlru.go 96.22% <0.00%> (+5.66%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

var blocks []bookkeeping.Block
var txPerBlock int
var numAss, numPay int
fmt.Printf("Preparing transactions and adding the blocks (/%d): ", numBlocks)
Copy link
Contributor

Choose a reason for hiding this comment

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

b.logf ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

b.logf will print at the end. This way it will be more interactive.

ledger/fullblock_perf_test.go Outdated Show resolved Hide resolved
ledger/fullblock_perf_test.go Outdated Show resolved Hide resolved
ledger/fullblock_perf_test.go Outdated Show resolved Hide resolved
ledger/fullblock_perf_test.go Outdated Show resolved Hide resolved
ledger/fullblock_perf_test.go Outdated Show resolved Hide resolved
@algorandskiy algorandskiy changed the title WIP: Block validation benchmark performance: block validation benchmark Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants