Skip to content

Commit

Permalink
Fix unsigned and signed integer compare
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcanadi committed Apr 29, 2014
1 parent 76c3dbf commit d0b006a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions util/benchharness_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,42 @@ BENCHMARK(insertFrontVector) {

BENCHMARK_RELATIVE(insertBackVector) {
std::vector<int> v;
for (int i = 0; i < 100; i++) {
for (size_t i = 0; i < 100; i++) {
v.insert(v.end(), i);
}
}

BENCHMARK_N(insertFrontVector_n, n) {
std::vector<int> v;
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.begin(), i);
}
}

BENCHMARK_RELATIVE_N(insertBackVector_n, n) {
std::vector<int> v;
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.end(), i);
}
}

BENCHMARK_N(insertFrontEnd_n, n) {
std::vector<int> v;
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.begin(), i);
}
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.end(), i);
}
}

BENCHMARK_RELATIVE_N(insertFrontEndSuspend_n, n) {
std::vector<int> v;
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.begin(), i);
}
BENCHMARK_SUSPEND {
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
v.insert(v.end(), i);
}
}
Expand Down

0 comments on commit d0b006a

Please sign in to comment.