mirror of
https://github.com/golang/go.git
synced 2025-10-19 19:13:18 +00:00
runtime: additional memmove benchmarks
For testing out duffcopy changes. Change-Id: I93b4a52d75418a6e31aae5ad99f95d1870812b69 Reviewed-on: https://go-review.googlesource.com/c/go/+/678215 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
eebae283b6
commit
49f6304724
1 changed files with 99 additions and 0 deletions
|
@ -1123,3 +1123,102 @@ func BenchmarkMemclrKnownSize512KiB(b *testing.B) {
|
|||
|
||||
memclrSink = x[:]
|
||||
}
|
||||
|
||||
func BenchmarkMemmoveKnownSize112(b *testing.B) {
|
||||
type T struct {
|
||||
x [112]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize128(b *testing.B) {
|
||||
type T struct {
|
||||
x [128]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize192(b *testing.B) {
|
||||
type T struct {
|
||||
x [192]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize248(b *testing.B) {
|
||||
type T struct {
|
||||
x [248]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize256(b *testing.B) {
|
||||
type T struct {
|
||||
x [256]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize512(b *testing.B) {
|
||||
type T struct {
|
||||
x [512]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
func BenchmarkMemmoveKnownSize1024(b *testing.B) {
|
||||
type T struct {
|
||||
x [1024]int8
|
||||
}
|
||||
p := &T{}
|
||||
q := &T{}
|
||||
|
||||
b.SetBytes(int64(unsafe.Sizeof(T{})))
|
||||
for i := 0; i < b.N; i++ {
|
||||
*p = *q
|
||||
}
|
||||
|
||||
memclrSink = p.x[:]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue