Skip to content

Commit

Permalink
s: prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
icorderi committed Jun 14, 2023
1 parent 3fc2842 commit 2876836
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ledger/eval/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (x *roundCowBase) prefetch(addr basics.Address) error {
if ad.CacheMiss {
// make the new data available immedietly
x.l.FlushCaches()
evalPrefetchMissAccounts.Inc(nil)
}
// TODO: consider adding a counter to when prefetch doesnt prefetch anything
return nil
Expand Down Expand Up @@ -959,6 +960,7 @@ func (eval *BlockEvaluator) PrefetchTransactionGroup(txgroup []transactions.Sign

switch txn.Type {
case protocol.PaymentTx:
cow.prefetch(txn.Receiver)
cow.prefetch(txn.CloseRemainderTo)
// TODO: write the rest
default:
Expand Down Expand Up @@ -1756,3 +1758,4 @@ transactionGroupLoop:
}

var evalCacheMissAccounts = metrics.NewCounter("eval_cache_miss_accounts", "missed accounts")
var evalPrefetchMissAccounts = metrics.NewCounter("eval_prefetch_miss_accounts", "missed accounts")

0 comments on commit 2876836

Please sign in to comment.