-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
testing.Benchmark does not seem to produce valid memory stats any more:
The following program:
package main
import (
"fmt"
"testing"
)
var global *int
func main() {
r := testing.Benchmark(func(b *testing.B) {
for i := 0; i < b.N; i++ {
global = new(int)
}
})
fmt.Printf("creating filter: %v\n", r.MemString())
}
always prints:
0 B/op 0 allocs/op
I'd expect it to print
8 B/op 1 allocs/op
like previous Go versions.
go version devel +eab99a8 Mon Jun 26 21:12:22 2017 +0000 linux/amd64
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.