mirror of https://github.com/golang/go.git
simplify new benchmark
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
parent
6e7a43135b
commit
9bbaa1854a
|
|
@ -1944,17 +1944,13 @@ func BenchmarkCall(b *testing.B) {
|
||||||
|
|
||||||
type myint int64
|
type myint int64
|
||||||
|
|
||||||
type inccer interface {
|
|
||||||
inc()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i *myint) inc() {
|
func (i *myint) inc() {
|
||||||
*i = *i + 1
|
*i = *i + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkCallMethod(b *testing.B) {
|
func BenchmarkCallMethod(b *testing.B) {
|
||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
z := inccer(new(myint))
|
z := new(myint)
|
||||||
|
|
||||||
v := ValueOf(z.inc)
|
v := ValueOf(z.inc)
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue