-
Notifications
You must be signed in to change notification settings - Fork 524
performance: turn cache misses during assembly into cache hits during eval #4617
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
Conversation
988803e to
93a1624
Compare
Codecov Report
@@ Coverage Diff @@
## master #4617 +/- ##
==========================================
- Coverage 54.55% 54.37% -0.19%
==========================================
Files 414 407 -7
Lines 53607 52389 -1218
==========================================
- Hits 29244 28485 -759
+ Misses 21935 21525 -410
+ Partials 2428 2379 -49
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
93a1624 to
02dccd7
Compare
dcd4447 to
0c2e549
Compare
shared/pingpong/config.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
algorandskiy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix two remarks and this is good to go
0c2e549 to
974968e
Compare
jannotti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was already merged, but wanted to note a couple thnigs.
Biggest comment is on code that isn't here. Although boxes were rebased into this, I don't see the analogous changes for lrukv.go.
| return macct.AccountResource(), rnd, nil | ||
| } | ||
|
|
||
| // check baseAccoiunts again to see if it does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"baseResources"
| return macct.accountData.GetLedgerCoreAccountData(), rnd, rewardsVersion, rewardsLevel, nil | ||
| } | ||
|
|
||
| // check baseAccoiunts again to see if it does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"baseAccounts" (sp)
| } | ||
|
|
||
| // clear the notFound list | ||
| m.notFound = make(map[basics.Address]struct{}, len(m.notFound)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supposedly, deleting in a loop over all keys is recognized by the compiler and optimized to be cheaper than reallocating. @cce posted something about it. https://go-review.googlesource.com/c/go/+/110055
| } | ||
|
|
||
| // clear the notFound list | ||
| m.notFound = make(map[accountCreatable]struct{}, len(m.notFound)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Summary
The problem statement applies both to accounts and resources.
Additionally, we taught the LRU to track accounts and resources that were not found in the DB.
Thus avoiding repeated DB queries on objects that do not exist.
Test Plan
Benchmark on
scenario-1sWe run the scenario-1s with the default script and using a random destination (max200k) both on master and this branch.
The transactions per second (TPS) results are shown in figure 1.