Skip to content

testing: report allocations in the BenchmarkResult struct Stringer #24296

Description

@titpetric

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.10

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Not applicable

What did you do?

Call testing.Benchmark when using b.ReportAllocs() in the benchmark function.

What did you expect to see?

New  1000000          1232 ns/op        0 B/op         0 allocs/op
A.New  1000000        1169 ns/op        0 B/op         0 allocs/op

What did you see instead?

New  1000000          1171 ns/op
A.New  1000000        1115 ns/op

Activity

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

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions