Skip to content

Commit

Permalink
lruAccounts benchmark: a more controlled distribution between account…
Browse files Browse the repository at this point in the history
…s in the benchmark
  • Loading branch information
algonathan committed Jun 21, 2021
1 parent d8f5b33 commit b27ab2c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ledger/lruaccts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ func TestLRUAccountsOmittedPendingWrites(t *testing.T) {
}

func BenchmarkLRUAccountsWrite(b *testing.B) {
accounts := generatePersistedAccountData(0, 5000)
fillerAccounts := generatePersistedAccountData(5000, 100000)
numTestAccounts := 5000
// there are 2500 accounts that overlap
fillerAccounts := generatePersistedAccountData(0, 97500)
accounts := generatePersistedAccountData(97500-numTestAccounts/2, 97500+numTestAccounts/2)

b.ResetTimer()
b.StopTimer()
Expand Down Expand Up @@ -231,7 +233,7 @@ func generatePersistedAccountData(startRound, endRound int) []persistedAccountDa

accounts[i-startRound] = persistedAccountData{
addr: basics.Address(digest),
round: basics.Round(i),
round: basics.Round(i + startRound),
rowid: int64(i),
accountData: basics.AccountData{MicroAlgos: basics.MicroAlgos{Raw: uint64(i)}},
}
Expand Down

0 comments on commit b27ab2c

Please sign in to comment.