42 runArithmeticBench<uint8_t>(iters);
46 runArithmeticBench<uint16_t>(iters);
50 runArithmeticBench<uint32_t>(iters);
54 constexpr
size_t kNumPushPerIter = 1024;
58 for (
size_t i = 0;
i < kNumPushPerIter; ++
i) {
59 appender.
push(reinterpret_cast<const uint8_t*>(str.data()), str.size());
82 constexpr
size_t kNumAppendPerIter = 1024;
84 std::unique_ptr<folly::IOBuf> largeBuffer;
93 for (
size_t i = 0;
i < kNumAppendPerIter; ++
i) {
133 gflags::ParseCommandLineFlags(&argc, &argv,
true);
constexpr size_t kBenchmarkSize
void runPushBenchmark(int64_t iters, const std::string &str)
static std::unique_ptr< IOBuf > create(std::size_t capacity)
#define BENCHMARK_SUSPEND
std::enable_if< std::is_arithmetic< T >::value >::type write(T value)
void append(std::unique_ptr< IOBuf > &buf, StringPiece str)
void runArithmeticBench(int64_t iters)
void push(const uint8_t *buf, size_t len)
std::unique_ptr< folly::IOBuf > move()
std::unique_ptr< IOBuf > clone() const
std::pair< void *, std::size_t > preallocate(std::size_t min, std::size_t newAllocationSize, std::size_t max=std::numeric_limits< std::size_t >::max())
void insert(std::unique_ptr< folly::IOBuf > buf)
constexpr auto size(C const &c) -> decltype(c.size())
constexpr auto data(C &c) -> decltype(c.data())
constexpr Range< Iter > range(Iter first, Iter last)
void preallocate_postallocate_bench(int64_t iters, size_t size)
BENCHMARK(fbFollyGlobalBenchmarkBaseline)
int main(int argc, char **argv)
void postallocate(std::size_t n)
void append(std::size_t amount)
auto doNotOptimizeAway(const T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type