Skip to content

Commit a19fef3

Browse files
committed
Docs: Listing Google Benchmark APIs
1 parent 1539624 commit a19fef3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,32 @@ Come on!
105105
</tr>
106106
</table>
107107

108+
## Google Benchmark Functionality
109+
110+
This benchmark suite uses most of the features provided by Google Benchmark.
111+
If you write a lot of benchmarks and avoid going to the full [User Guide](https://github.com/google/benchmark/blob/main/docs/user_guide.md), here is a condensed list of the most useful features:
112+
113+
- `->Args({x, y})` - Pass multiple arguments to parameterized benchmarks
114+
- `BENCHMARK()` - Register a basic benchmark function
115+
- `BENCHMARK_CAPTURE()` - Create variants of benchmarks with different captured values
116+
- `Counter::kAvgThreads` - Specify thread-averaged counters
117+
- `DoNotOptimize()` - Prevent compiler from optimizing away operations
118+
- `ClobberMemory()` - Force memory synchronization
119+
- `->Complexity(oNLogN)` - Specify and validate algorithmic complexity
120+
- `->SetComplexityN(n)` - Set input size for complexity calculations
121+
- `->ComputeStatistics("max", ...)` - Calculate custom statistics across runs
122+
- `->Iterations(n)` - Control exact number of iterations
123+
- `->MinTime(n)` - Set minimum benchmark duration
124+
- `->MinWarmUpTime(n)` - To warm up the data caches
125+
- `->Name("...")` - Assign custom benchmark names
126+
- `->Range(start, end)` - Profile for a range of input sizes
127+
- `->RangeMultiplier(n)` - Set multiplier between range values
128+
- `->ReportAggregatesOnly()` - Show only aggregated statistics
129+
- `state.counters["name"]` - Create custom performance counters
130+
- `state.PauseTiming()`, `ResumeTiming()` - Control timing measurement
131+
- `state.SetBytesProcessed(n)` - Record number of bytes processed
132+
- `state.SkipWithError()` - Skip benchmark with error message
133+
- `->Threads(n)` - Run benchmark with specified number of threads
134+
- `->Unit(kMicrosecond)` - Set time unit for reporting
135+
- `->UseRealTime()` - Measure real time instead of CPU time
136+
- `->UseManualTime()` - To feed custom timings for GPU and IO benchmarks

0 commit comments

Comments
 (0)