performance: turn cache misses during assembly into cache hits during eval#4617
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
algorandskiy
left a comment
There was a problem hiding this comment.
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.
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 |
| return macct.accountData.GetLedgerCoreAccountData(), rnd, rewardsVersion, rewardsLevel, nil | ||
| } | ||
|
|
||
| // check baseAccoiunts again to see if it does not exist |
| } | ||
|
|
||
| // clear the notFound list | ||
| m.notFound = make(map[basics.Address]struct{}, len(m.notFound)) |
There was a problem hiding this comment.
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)) |
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.