19 #include <glog/logging.h> 31 static std::atomic<int>
testSize(1000);
35 |
mapped([](
int) {
return rand(); })
41 return seq(1, i) | as<vector>();
56 for (
int i = 0; i < limit; ++
i) {
77 for (
auto& i : testVector) {
123 for (
auto& i : testVector) {
124 if (i * 2 < rand()) {
136 s +=
from(testVector)
138 return i * 2 < rand();
151 auto fib = [](
size_t limit) -> vector<int> {
155 for (
size_t i = 0; i < limit; i += 2) {
156 ret.push_back(a += b);
157 ret.push_back(b += a);
192 for (
size_t i = 0; i < limit; i += 2) {
204 template <
class Yield>
229 auto numbers =
seq(1, 10000);
275 for (
auto&
v : testVectorVector) {
297 for (
auto& i : testVector) {
308 s +=
from(testVector) | sumSq;
326 auto sampler =
seq(1, 10 * 1000 * 1000) |
sample(1000);
327 s += (sampler |
sum);
368 gflags::ParseCommandLineFlags(&argc, &argv,
true);
BENCHMARK_RELATIVE(Sum_Basic_Gen, iters)
constexpr detail::Count count
static std::atomic< int > testSize(1000)
From from(Container &source)
static vector< vector< int > > testVectorVector
Gen seq(Value first, Value last)
detail::Sample< Random > sample(size_t count, Random rng=Random())
constexpr detail::Sum sum
Gen range(Value begin, Value end)
constexpr detail::RangeConcat rconcat
Map map(Predicate pred=Predicate())
Filter filter(Predicate pred=Predicate())
int main(int argc, char *argv[])
std::enable_if< ExprIsConst< Constness >::value, Map >::type member(Return(Class::*member)() const)
static vector< int > testVector
BENCHMARK(fbFollyGlobalBenchmarkBaseline)
detail::Take take(Number count)
Map mapped(Predicate pred=Predicate())
void operator()(Yield &&yield) const
basic_fbstring< char > fbstring
static vector< fbstring > strings
auto doNotOptimizeAway(const T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type