#include <folly/Benchmark.h>
#include <folly/Foreach.h>
+#if FOLLY_HAVE_EXTRANDOM_SFMT19937
+#include <ext/random>
+#endif
+
using namespace folly;
BENCHMARK(minstdrand, n) {
FOR_EACH_RANGE(i, 0, n) { doNotOptimizeAway(rng()); }
}
+#if FOLLY_HAVE_EXTRANDOM_SFMT19937
+BENCHMARK(sfmt19937, n) {
+ BenchmarkSuspender braces;
+ std::random_device rd;
+ __gnu_cxx::sfmt19937 rng(rd());
+
+ braces.dismiss();
+
+ FOR_EACH_RANGE(i, 0, n) { doNotOptimizeAway(rng()); }
+}
+#endif
+
BENCHMARK(threadprng, n) {
BenchmarkSuspender braces;
ThreadLocalPRNG tprng;