mirror of
https://github.com/golang/go
synced 2024-11-12 09:50:21 -07:00
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
This commit is contained in:
parent
ebfc7e862e
commit
2ac289c4a0
@ -162,6 +162,18 @@ func BenchmarkMemclr256(b *testing.B) { bmMemclr(b, 256) }
|
||||
func BenchmarkMemclr4096(b *testing.B) { bmMemclr(b, 4096) }
|
||||
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) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
var x [16 / 4]uint32
|
||||
@ -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) {
|
||||
var x [16 / 4]uint32
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
Loading…
Reference in New Issue
Block a user