Commit a640baa1 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Dave Watson

Fix off-by-one affecting benchmark numbers in folly/io.

Summary: Fix off-by-one affecting benchmark numbers in folly/io.

Test Plan:
$ fbconfig -r folly/io/test
$ fbmake --fast opt
$ _build/opt/folly/io/test/iobuf_cursor_test --benchmark
$ _build/opt/folly/io/test/iobuf_network_bench --benchmark

Reviewed By: simpkins@fb.com

FB internal diff: D1199679

Blame Revision: D344018
parent ac11c858
......@@ -591,20 +591,20 @@ void runBenchmark() {
}
BENCHMARK(rwPrivateCursorBenchmark, iters) {
while (--iters) {
while (iters--) {
runBenchmark<RWPrivateCursor>();
}
}
BENCHMARK(rwUnshareCursorBenchmark, iters) {
while (--iters) {
while (iters--) {
runBenchmark<RWUnshareCursor>();
}
}
BENCHMARK(cursorBenchmark, iters) {
while (--iters) {
while (iters--) {
Cursor c(iobuf_read_benchmark.get());
for(int i = 0; i < benchmark_size ; i++) {
c.read<uint8_t>();
......@@ -614,7 +614,7 @@ BENCHMARK(cursorBenchmark, iters) {
BENCHMARK(skipBenchmark, iters) {
uint8_t buf;
while (--iters) {
while (iters--) {
Cursor c(iobuf_read_benchmark.get());
for(int i = 0; i < benchmark_size ; i++) {
c.peek();
......
......@@ -31,7 +31,7 @@ size_t buf_size = 0;
size_t num_bufs = 0;
BENCHMARK(reserveBenchmark, iters) {
while (--iters) {
while (iters--) {
unique_ptr<IOBuf> iobuf1(IOBuf::create(buf_size));
iobuf1->append(buf_size);
for (size_t bufs = num_bufs; bufs > 1; bufs --) {
......@@ -42,7 +42,7 @@ BENCHMARK(reserveBenchmark, iters) {
}
BENCHMARK(chainBenchmark, iters) {
while (--iters) {
while (iters--) {
unique_ptr<IOBuf> iobuf1(IOBuf::create(buf_size));
iobuf1->append(buf_size);
for (size_t bufs = num_bufs; bufs > 1; bufs --) {
......@@ -75,7 +75,7 @@ inline void poolPutIOBuf(unique_ptr<IOBuf>&& buf) {
}
BENCHMARK(poolBenchmark, iters) {
while (--iters) {
while (iters--) {
unique_ptr<IOBuf> head = std::move(poolGetIOBuf());
for (size_t bufs = num_bufs; bufs > 1; bufs --) {
unique_ptr<IOBuf> iobufNext = std::move(poolGetIOBuf());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment