Can specify or unify the time unit for bench testing

Open
#2,908 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

No file, test, or entry point is named. Begin by locating the benchmark result formatting and its existing tests, then verify that output can use a consistent time unit and standardized decimal precision across the examples shown; done means the benchmark output is unambiguous and consistently formatted.

Written by the indexing model from the issue text.

Description

Description

When I run catch2 benchmarks, I got some result like:

benchmark name                            samples    iterations          mean
-------------------------------------------------------------------------------
xxx                                            100           138    145.246 ns
xxx                                            100            81    245.556 ns
xxx                                            100            49    408.755 ns
xxx                                            100            35    572.086 ns
xxx                                            100           117     150.47 ns
xxx                                            100            70    287.971 ns
xxx                                            100             5     4.2428 us
xxx                                            100           100     199.36 ns

There is a microsecond in a pile of nanoseconds, which can easily cause confusion. Is there any way to unify the time unit?

Furthermore, can the precision of decimal output be standardized? For example, all outputs are to two decimal places.

Dominant language
C++
Stars
21.6k
Forks
3.4k
Avg merge
3d 12h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from catchorg/Catch2

All issues in catchorg/Catch2

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.