Skip to content

Commit

Permalink
Update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Jul 28, 2017
1 parent 2e9d73e commit 1b973de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ func benchFind(b *testing.B, db *DB) {
b.ReportAllocs()

for i := 0; i < b.N; i++ {
b.StopTimer()
persons := []*Person{}
b.StartTimer()
if err := db.Find(&persons); err != nil {
b.Fatalf("error finding: %s", err)
}
Expand Down Expand Up @@ -174,8 +176,11 @@ func benchFindSQL(b *testing.B, db *DB) {
b.ReportAllocs()

for i := 0; i < b.N; i++ {
b.StopTimer()
persons := []*Person{}
if _, err := db.FindSQL(&persons); err != nil {
var err error
b.StartTimer()
if _, err = db.FindSQL(&persons); err != nil {
b.Fatalf("error finding: %s", err)
}
}
Expand Down

0 comments on commit 1b973de

Please sign in to comment.