25 using namespace folly;
51 for (
long i = 0;
i < n; ++
i) {
52 for (
long j = 0; j < 10000; ++j) {
58 BENCHMARK(optimizerCanPowerReduceInner1Trivial, n) {
60 for (
long i = 0;
i < n; ++
i) {
61 for (
long j = 0; j < 10000; ++j) {
68 BENCHMARK(optimizerCanPowerReduceInner2Trivial, n) {
70 for (
long i = 0;
i < n; ++
i) {
72 for (
long j = 0; j < 10000; ++j) {
81 for (
long i = 0;
i < n; ++
i) {
82 for (
long j = 0; j < 10000; ++j) {
91 for (
long i = 0;
i < n; ++
i) {
93 for (
long j = 0; j < 10000; ++j) {
103 for (
long i = 0;
i < n; ++
i) {
104 for (
long j = 0; j < 10000; ++j) {
113 for (
long i = 0;
i < n; ++
i) {
115 for (
long j = 0; j < 10000; ++j) {
124 for (
long i = 0;
i < n; ++
i) {
125 for (
long j = 0; j < 10000; ++j) {
133 class NonTrivialLong {
135 explicit NonTrivialLong(
long v) : value_(v) {}
136 virtual ~NonTrivialLong() {}
145 value_ += rhs.value_;
150 NonTrivialLong
operator+(
const NonTrivialLong& rhs) {
151 return NonTrivialLong(value_ + rhs.value_);
162 for (NonTrivialLong
i(0);
i < n; ++
i) {
163 for (NonTrivialLong j(0); j < 10000; ++j) {
171 for (NonTrivialLong
i(0);
i < n; ++
i) {
172 for (NonTrivialLong j(0); j < 10000; ++j) {
181 for (NonTrivialLong
i(0);
i < n; ++
i) {
183 for (NonTrivialLong j(0); j < 10000; ++j) {
192 for (NonTrivialLong
i(0);
i < n; ++
i) {
193 for (NonTrivialLong j(0); j < 10000; ++j) {
202 for (NonTrivialLong
i(0);
i < n; ++
i) {
204 for (NonTrivialLong j(0); j < 10000; ++j) {
212 BENCHMARK(optimizerCanPowerReduceInner1NonTrivialPtr, n) {
214 for (NonTrivialLong
i(0);
i < n; ++
i) {
215 for (NonTrivialLong j(0); j < 10000; ++j) {
222 BENCHMARK(optimizerCanPowerReduceInner2NonTrivialPtr, n) {
224 for (NonTrivialLong
i(0);
i < n; ++
i) {
226 for (NonTrivialLong j(0); j < 10000; ++j) {
235 for (NonTrivialLong
i(0);
i < n; ++
i) {
236 for (NonTrivialLong j(0); j < 10000; ++j) {
299 for (
unsigned i = 0;
i < iter; ++
i) {
300 for (
unsigned j = 0; j < num; ++j) {
308 for (
unsigned i = 0;
i < iter; ++
i) {
309 for (
unsigned j = 0; j < num; ++j) {
329 vector<size_t>
v(1 << 12, 0);
330 iota(v.begin(), v.end(), 0);
331 shuffle(v.begin(), v.end(),
rng);
332 braces.
dismissing([&] { sort(v.begin(), v.end()); });
340 vector<size_t>
v(1 << 12, 0);
341 iota(v.begin(), v.end(), 0);
342 shuffle(v.begin(), v.end(),
rng);
344 sort(v.begin(), v.end());
346 v.begin(), v.end(), 0, [](
size_t a,
size_t e) {
return a + e; });
353 gflags::ParseCommandLineFlags(&argc, &argv,
true);
#define BENCHMARK_RELATIVE_PARAM_MULTI(name, param)
void accumulate(std::vector< std::size_t > &a, std::vector< std::size_t > const &d)
#define BENCHMARK_SUSPEND
Future< Unit > sleep(Duration dur, Timekeeper *tk)
—— Concurrent Priority Queue Implementation ——
FOLLY_PUSH_WARNING RHS rhs
#define FOR_EACH_RANGE(i, begin, end)
BENCHMARK_RELATIVE(bmVector)
unsigned paramMultiRel(unsigned iter, unsigned num)
#define BENCHMARK_PARAM_MULTI(name, param)
BENCHMARK_MULTI(multiSimple)
BENCHMARK(fbFollyGlobalBenchmarkBaseline)
auto dismissing(F f) -> invoke_result_t< F >
unsigned paramMulti(unsigned iter, unsigned num)
bool runBenchmarksOnFlag()
basic_fbstring< E, T, A, S > operator+(const basic_fbstring< E, T, A, S > &lhs, const basic_fbstring< E, T, A, S > &rhs)
LogLevel & operator+=(LogLevel &level, uint32_t value)
auto makeUnpredictable(T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type
int main(int argc, char **argv)
BENCHMARK_RELATIVE_MULTI(multiSimpleRel)
std::enable_if< IsLessThanComparable< Value >::value, bool >::type operator<(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
auto doNotOptimizeAway(const T &datum) -> typename std::enable_if< !detail::DoNotOptimizeAwayNeedsIndirect< T >::value >::type