Skip to content

testing: lost ns/op precision for fast benchmarks [regression] #30997

Description

@josharian

CL 166717 caused a regression in benchmark ns/op printing precision.

We now get benchmark output like:

BenchmarkFast-8     	380491575	         3.00 ns/op

Previously, we got:

BenchmarkFast-8     	380491575	         3.12 ns/op

This is due to a change in BenchmarkResult.String. Previously, when ns/op was small, it recalculated it to get extra precision and had special print handling. Now it always uses the results of BenchmarkResult.NsPerOp, which returns an int64.

cc @aclements

Activity

  1. added this to the Go1.13 milestone on Mar 22, 2019
  2. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Mar 22, 2019
  3. gopherbot commented on Mar 22, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/168937 mentions this issue: testing: fix fractional ns/op printing

  4. locked and limited conversation to collaborators on Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions