X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fio%2Ftest%2FIOBufCursorBenchmark.cpp;h=465691c0dc71503645ec4e266e9a9c56fc808f79;hb=27945a697803eab3c471aa22780c8b32ced45fdf;hp=e7142d9c214cfc84cdca3d474eb84991ff9bd4e8;hpb=705e7518ea5685ee7812d96dae277787e15d5ca8;p=folly.git diff --git a/folly/io/test/IOBufCursorBenchmark.cpp b/folly/io/test/IOBufCursorBenchmark.cpp index e7142d9c..465691c0 100644 --- a/folly/io/test/IOBufCursorBenchmark.cpp +++ b/folly/io/test/IOBufCursorBenchmark.cpp @@ -20,7 +20,6 @@ #include #include #include -#include DECLARE_bool(benchmark); @@ -70,12 +69,22 @@ BENCHMARK(skipBenchmark, iters) { while (iters--) { Cursor c(iobuf_read_benchmark.get()); for (int i = 0; i < benchmark_size; i++) { - c.peek(); + c.peekBytes(); c.skip(1); } } } +BENCHMARK(cloneBenchmark, iters) { + folly::IOBuf out; + while (iters--) { + Cursor c(iobuf_read_benchmark.get()); + for (int i = 0; i < benchmark_size; ++i) { + c.clone(out, 1); + } + } +} + // fbmake opt // _bin/folly/experimental/io/test/iobuf_cursor_test -benchmark //