#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/io/Cursor.h>
-#include <folly/io/Cursor-defs.h>
DECLARE_bool(benchmark);
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
//