Skip to content

Commit

Permalink
fix benchmark timers
Browse files Browse the repository at this point in the history
Signed-off-by: Kosuke Morimoto <kou.morimoto@gmail.com>
  • Loading branch information
kmrmt authored and actions-user committed Aug 27, 2020
1 parent 1a6c589 commit 9655fcd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions hack/benchmark/core/benchmark/strategy/bulk_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
}
v = append(v, arr.([]float32))
}

b.StopTimer()
b.ReportAllocs()
b.ResetTimer()
b.StartTimer()
defer b.StopTimer()
ids, errs := c.BulkInsert(v)
return ids, wrapErrors(errs)
},
Expand All @@ -73,8 +76,11 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
}
v = append(v, float32To64(arr.([]float32)))
}

b.StopTimer()
b.ReportAllocs()
b.ResetTimer()
b.StartTimer()
defer b.StopTimer()
ids, errs := c.BulkInsert(v)
return ids, wrapErrors(errs)
},
Expand Down
10 changes: 8 additions & 2 deletions hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
}
v = append(v, arr.([]float32))
}

b.StopTimer()
b.ReportAllocs()
b.ResetTimer()
b.StartTimer()
defer b.StopTimer()
ids, errs := c.BulkInsertCommit(v, poolSize)
return ids, wrapErrors(errs)
},
Expand All @@ -69,8 +72,11 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
}
v = append(v, float32To64(arr.([]float32)))
}

b.StopTimer()
b.ReportAllocs()
b.ResetTimer()
b.StartTimer()
defer b.StopTimer()
ids, errs := c.BulkInsertCommit(v, poolSize)
return ids, wrapErrors(errs)
},
Expand Down

0 comments on commit 9655fcd

Please sign in to comment.