We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dd5867 commit 23b2040Copy full SHA for 23b2040
src/reflect/all_test.go
@@ -1942,6 +1942,26 @@ func BenchmarkCall(b *testing.B) {
1942
})
1943
}
1944
1945
+type myint int64
1946
+
1947
+type inccer interface {
1948
+ inc()
1949
+}
1950
1951
+func (i *myint) inc() {
1952
+ *i = *i + 1
1953
1954
1955
+func BenchmarkCallMethod(b *testing.B) {
1956
+ b.ReportAllocs()
1957
+ z := inccer(new(myint))
1958
1959
+ v := ValueOf(z.inc)
1960
+ for i := 0; i < b.N; i++ {
1961
+ v.Call(nil)
1962
+ }
1963
1964
1965
func BenchmarkCallArgCopy(b *testing.B) {
1966
byteArray := func(n int) Value {
1967
return Zero(ArrayOf(n, TypeOf(byte(0))))
0 commit comments