3-phase PV router
Loading...
Searching...
No Matches
bench_report.h File Reference

Machine-readable lines per benchmark result, for the CI performance report. More...

#include <Arduino.h>
Include dependency graph for bench_report.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void benchCycles (const __FlashStringHelper *name, const uint32_t cycles, const uint32_t ops=1)
 A result in CPU cycles, reported twice: in microseconds and in cycles.
 
void benchPrefix (const __FlashStringHelper *name, const __FlashStringHelper *suffix)
 The start of a BENCH line, up to the separator before the value.
 
uint32_t centiCycles (const uint32_t cycles, const uint32_t ops)
 cycles / ops in hundredths of a cycle, rounded.
 
uint32_t deciMicros (const uint32_t cycles, const uint32_t ops)
 cycles / ops in 1/10000 us at 16 MHz, rounded (exact for ops = 1: 1 cycle = 625).
 
void printDecimal (const uint32_t value, const uint8_t decimals)
 Prints value / 10^decimals with that many decimals, zero-padded: 27326, 4 -> 2.7326.
 
void printPerOp (const uint32_t cycles, const uint32_t ops=1)
 Prints "<cycles> cycles = <us> us" for one operation, for the human-readable output.
 

Detailed Description

Machine-readable lines per benchmark result, for the CI performance report.

Prints BENCH|<name>|<value>|<unit> on its own line. CI collects these lines from the verbose output of the embedded tests (scripts/ci/bench_to_json.py), measures the target branch of a pull request in the same run, and posts the comparison as a comment (scripts/ci/pr_report.py); each push to dev adds them to the history on GitHub Pages (scripts/ci/pages_update.py). Smaller is better. simavr is cycle-accurate, so the values are exact and the same from run to run.

The name must stay the same over time: it is the key of the comparison.

Definition in file bench_report.h.

Function Documentation

◆ benchCycles()

void benchCycles ( const __FlashStringHelper * name,
const uint32_t cycles,
const uint32_t ops = 1 )
inline

A result in CPU cycles, reported twice: in microseconds and in cycles.

<name> [us] is cycles / 16 at 16 MHz, with four decimals (exact for a single call: 1/16 = 0.0625). <name> [cycles] is the count itself, with two decimals for a loop. Measured with BenchTimer (bench_timer.h), or with Timer1 directly.

Parameters
namethe name, saying what one operation is for a loop ("... per op")
cyclesthe cycles of the whole loop
opsthe operations in the loop, to report one of them: 1 for a single call

Definition at line 96 of file bench_report.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ benchPrefix()

void benchPrefix ( const __FlashStringHelper * name,
const __FlashStringHelper * suffix )
inline

The start of a BENCH line, up to the separator before the value.

Definition at line 76 of file bench_report.h.

Here is the caller graph for this function:

◆ centiCycles()

uint32_t centiCycles ( const uint32_t cycles,
const uint32_t ops )
inline

cycles / ops in hundredths of a cycle, rounded.

Definition at line 43 of file bench_report.h.

Here is the caller graph for this function:

◆ deciMicros()

uint32_t deciMicros ( const uint32_t cycles,
const uint32_t ops )
inline

cycles / ops in 1/10000 us at 16 MHz, rounded (exact for ops = 1: 1 cycle = 625).

Definition at line 49 of file bench_report.h.

Here is the caller graph for this function:

◆ printDecimal()

void printDecimal ( const uint32_t value,
const uint8_t decimals )
inline

Prints value / 10^decimals with that many decimals, zero-padded: 27326, 4 -> 2.7326.

Definition at line 21 of file bench_report.h.

Here is the caller graph for this function:

◆ printPerOp()

void printPerOp ( const uint32_t cycles,
const uint32_t ops = 1 )
inline

Prints "<cycles> cycles = <us> us" for one operation, for the human-readable output.

Parameters
cyclesthe cycles of the whole loop
opsthe operations in the loop: 1 for a single call

Definition at line 60 of file bench_report.h.

Here is the call graph for this function:
Here is the caller graph for this function: