summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/append_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/append_test.go')
-rw-r--r--libgo/go/runtime/append_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/go/runtime/append_test.go b/libgo/go/runtime/append_test.go
index 6b8968e382d..6bd8f3bd951 100644
--- a/libgo/go/runtime/append_test.go
+++ b/libgo/go/runtime/append_test.go
@@ -100,6 +100,22 @@ func BenchmarkAppendSlice(b *testing.B) {
}
}
+var (
+ blackhole []byte
+)
+
+func BenchmarkAppendSliceLarge(b *testing.B) {
+ for _, length := range []int{1 << 10, 4 << 10, 16 << 10, 64 << 10, 256 << 10, 1024 << 10} {
+ y := make([]byte, length)
+ b.Run(fmt.Sprint(length, "Bytes"), func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ blackhole = nil
+ blackhole = append(blackhole, y...)
+ }
+ })
+ }
+}
+
func BenchmarkAppendStr(b *testing.B) {
for _, str := range []string{
"1",