Commit 2ac289c4 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

runtime: add Benchmark[Clear|Copy]Fat[8|12]

These correspond to 2 and 3 word fat copies/clears on 8g, which dominate usage in the stdlib. (70% of copies and 46% of clears are for 2 or 3 words.) I missed these in CL 111350043, which added 2 and 3 word benchmarks for 6g. A follow-up CL will optimize these cases.

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/115160043
parent ebfc7e86
...@@ -162,6 +162,18 @@ func BenchmarkMemclr256(b *testing.B) { bmMemclr(b, 256) } ...@@ -162,6 +162,18 @@ func BenchmarkMemclr256(b *testing.B) { bmMemclr(b, 256) }
func BenchmarkMemclr4096(b *testing.B) { bmMemclr(b, 4096) } func BenchmarkMemclr4096(b *testing.B) { bmMemclr(b, 4096) }
func BenchmarkMemclr65536(b *testing.B) { bmMemclr(b, 65536) } func BenchmarkMemclr65536(b *testing.B) { bmMemclr(b, 65536) }
func BenchmarkClearFat8(b *testing.B) {
for i := 0; i < b.N; i++ {
var x [8 / 4]uint32
_ = x
}
}
func BenchmarkClearFat12(b *testing.B) {
for i := 0; i < b.N; i++ {
var x [12 / 4]uint32
_ = x
}
}
func BenchmarkClearFat16(b *testing.B) { func BenchmarkClearFat16(b *testing.B) {
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
var x [16 / 4]uint32 var x [16 / 4]uint32
...@@ -211,6 +223,20 @@ func BenchmarkClearFat1024(b *testing.B) { ...@@ -211,6 +223,20 @@ func BenchmarkClearFat1024(b *testing.B) {
} }
} }
func BenchmarkCopyFat8(b *testing.B) {
var x [8 / 4]uint32
for i := 0; i < b.N; i++ {
y := x
_ = y
}
}
func BenchmarkCopyFat12(b *testing.B) {
var x [12 / 4]uint32
for i := 0; i < b.N; i++ {
y := x
_ = y
}
}
func BenchmarkCopyFat16(b *testing.B) { func BenchmarkCopyFat16(b *testing.B) {
var x [16 / 4]uint32 var x [16 / 4]uint32
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment