Split get_default() into two for deferred default construction
[folly.git] / folly / Benchmark.h
index 01e8ffee4948a2065af44d25c782b845d24b8cbc..dbe12145ef79bd4c5dde046c6efa2bf4fcf1e1fe 100644 (file)
@@ -55,6 +55,19 @@ namespace detail {
 
 using TimeIterPair =
     std::pair<std::chrono::high_resolution_clock::duration, unsigned int>;
+using BenchmarkFun = std::function<detail::TimeIterPair(unsigned int)>;
+
+struct BenchmarkRegistration {
+  std::string file;
+  std::string name;
+  BenchmarkFun func;
+};
+
+struct BenchmarkResult {
+  std::string file;
+  std::string name;
+  double timeInNs;
+};
 
 /**
  * Adds a benchmark wrapped in a std::function. Only used
@@ -280,6 +293,20 @@ auto makeUnpredictable(T& datum) -> typename std::enable_if<
 
 #endif
 
+struct dynamic;
+
+void benchmarkResultsToDynamic(
+    const std::vector<detail::BenchmarkResult>& data,
+    dynamic&);
+
+void benchmarkResultsFromDynamic(
+    const dynamic&,
+    std::vector<detail::BenchmarkResult>&);
+
+void printResultComparison(
+    const std::vector<detail::BenchmarkResult>& base,
+    const std::vector<detail::BenchmarkResult>& test);
+
 } // namespace folly
 
 /**