13#include "../../tracktion_graph/utilities/tracktion_PerformanceMeasurement.h"
36 category, name, description };
44 double totalSeconds = 0.0, meanSeconds = 0.0, minSeconds = 0.0, maxSeconds = 0.0, varianceSeconds = 0.0;
45 uint64_t totalCycles = 0, meanCycles = 0, minCycles = 0, maxCycles = 0;
46 double varianceCycles = 0.0;
55 stats.totalSeconds, stats.meanSeconds, stats.minimumSeconds, stats.maximumSeconds, stats.getVarianceSeconds(),
56 stats.totalCycles, (
uint64_t) stats.meanCycles, stats.minimumCycles, stats.maximumCycles, stats.getVarianceCycles() };
73 : description (
std::move (desc))
119 results.emplace_back (std::move (r));
133 return results.clear();
164 : benchmark (
std::move (desc))
static String getOperatingSystemName()
static Time JUCE_CALLTYPE getCurrentTime() noexcept
Contans a list of BenchmarkResult[s].
void clear()
Removes all the current results.
static BenchmarkList & getInstance()
Gets the singleton instance.
void addResult(BenchmarkResult r)
Adds a result to the list.
std::vector< BenchmarkResult > getResults() const
Returns all the results.
BenchmarkList()=default
Constructs a BenchmarkList.
BenchmarkResult getResult() const
Returns the timing results.
void stop()
Stops timing the benchmark.
Benchmark(BenchmarkDescription desc)
Creates a Benchmark for a given BenchmarkDescription.
void start()
Starts timing the benchmark.
std::string category
A category for grouping.
size_t hash
A hash uniquely identifying this benchmark.
std::string name
A human-readable name for the benchmark.
std::string platform
A platform string.
BenchmarkDescription description
The BenchmarkDescription.
BenchmarkDescription createBenchmarkDescription(std::string category, std::string name, std::string description)
Creates a description by hashing the name and description fields.
std::string description
An optional description that might include configs etc.
BenchmarkResult createBenchmarkResult(BenchmarkDescription description, const tracktion::graph::PerformanceMeasurement::Statistics &stats)
Creates a BenchmarkResult from a set of Statistics.
Holds the duration a benchmark took to run.
Helper class for measuring a benchmark and adding it to the singleton BenchmarkList list.
~ScopedBenchmark()
Stops the Benchmark and adds the result to the BenchmarkList.
ScopedBenchmark(BenchmarkDescription desc)
Constructs and starts a Benchmark.
Helper class for starting/stopping a benchmark measurement.
ScopedMeasurement(Benchmark &bm)
Constructs and starts a Benchmark.
~ScopedMeasurement()
Stops the Benchmark.