projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix HHWheelTimer comment typo
[folly.git]
/
folly
/
io
/
test
/
IOBufCursorBenchmark.cpp
diff --git
a/folly/io/test/IOBufCursorBenchmark.cpp
b/folly/io/test/IOBufCursorBenchmark.cpp
index e7142d9c214cfc84cdca3d474eb84991ff9bd4e8..465691c0dc71503645ec4e266e9a9c56fc808f79 100644
(file)
--- a/
folly/io/test/IOBufCursorBenchmark.cpp
+++ b/
folly/io/test/IOBufCursorBenchmark.cpp
@@
-20,7
+20,6
@@
#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/io/Cursor.h>
#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/io/Cursor.h>
-#include <folly/io/Cursor-defs.h>
DECLARE_bool(benchmark);
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++) {
while (iters--) {
Cursor c(iobuf_read_benchmark.get());
for (int i = 0; i < benchmark_size; i++) {
- c.peek();
+ c.peek
Bytes
();
c.skip(1);
}
}
}
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
//
// fbmake opt
// _bin/folly/experimental/io/test/iobuf_cursor_test -benchmark
//