google / google/benchmark

Introduce scientific notation for counters in console

Open
#818 4 comments 2 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Sometimes it becomes difficult to grasp immediately the differences between benchmarked functions that have a wide variance in a given counter.
The aforementioned readability problem is due to the usage of the SI standard by default.
This one below is an example where I am dealing with different functions to approximate sine, look at the absolute error calculated for each one:
![Screenshot_20190513_185727](https://user-images.githubusercontent.com/26225010/57644787-27e37e80-75bd-11e9-9e94-240e0e4af5f5.png)
It's not instantly obvious how much more precise the first function is, but it would be using scientific notation:
![Screenshot_20190513_202852](https://user-images.githubusercontent.com/26225010/57645061-c7a10c80-75bd-11e9-948d-a86f488662f7.png)

The usage might be as easy as:
```cpp
state.counters["Foo"] = Counter(fooVal, benchmark::Counter::kScientificNotation);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.