mirror of
https://github.com/google/benchmark.git
synced 2025-03-06 15:20:10 +08:00
Merge pull request #16 from chenshuo/master
Use a new container in each round of push_back test.
This commit is contained in:
commit
98e7f89d72
1
AUTHORS
1
AUTHORS
@ -16,4 +16,5 @@ Eugene Zhuk <eugene.zhuk@gmail.com>
|
||||
Felix Homann <linuxaudio@showlabor.de>
|
||||
Google Inc.
|
||||
Oleksandr Sochka <sasha.sochka@gmail.com>
|
||||
Shuo Chen <chenshuo@chenshuo.com>
|
||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
@ -30,4 +30,5 @@ Eugene Zhuk <eugene.zhuk@gmail.com>
|
||||
Felix Homann <linuxaudio@showlabor.de>
|
||||
Oleksandr Sochka <sasha.sochka@gmail.com>
|
||||
Pierre Phaneuf <pphaneuf@google.com>
|
||||
Shuo Chen <chenshuo@chenshuo.com>
|
||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
@ -86,12 +86,13 @@ BENCHMARK(BM_SetInsert)->RangePair(1<<10,8<<10, 1,10);
|
||||
|
||||
template<typename Q>
|
||||
static void BM_Sequential(benchmark::State& state) {
|
||||
Q q;
|
||||
typename Q::value_type v;
|
||||
while (state.KeepRunning())
|
||||
typename Q::value_type v = 42;
|
||||
while (state.KeepRunning()) {
|
||||
Q q;
|
||||
for (int i = state.range_x(); --i; )
|
||||
q.push_back(v);
|
||||
const int64_t items_processed =
|
||||
}
|
||||
const int64_t items_processed =
|
||||
static_cast<int64_t>(state.iterations()) * state.range_x();
|
||||
state.SetItemsProcessed(items_processed);
|
||||
state.SetBytesProcessed(items_processed * sizeof(v));
|
||||
|
Loading…
Reference in New Issue
Block a user