Skip to content

Improve bytes per second benchmark output #63776

Open
@software-opal

Description

@software-opal

I'm building a library that implements a somewhat slow compression algorithm and I wanted to see what sort of speeds I was getting. Using the benchmark I can get the speeds for some tests; but not for the slower ones:

test compress_large::level_0  ... bench:  10,848,110 ns/iter (+/- 343,409) = 1 MB/s
test compress_random::level_0 ... bench: 257,280,250 ns/iter (+/- 19,228,907)

It would be nice to have the speed output in other units, like KB/s and B/s. It could also be extended to produce GB/s if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions