Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(288)

Side by Side Diff: src/pkg/runtime/append_test.go

Issue 12440044: code review 12440044: runtime: tune append crossover on amd64 and 386 (Closed)
Patch Set: diff -r 0aee4b3eb910 https://code.google.com/p/go Created 11 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/runtime/arch_386.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 package runtime_test 4 package runtime_test
5 5
6 import "testing" 6 import "testing"
7 7
8 const N = 20 8 const N = 20
9 9
10 func BenchmarkAppend(b *testing.B) { 10 func BenchmarkAppend(b *testing.B) {
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 func BenchmarkAppend1Byte(b *testing.B) { 33 func BenchmarkAppend1Byte(b *testing.B) {
34 benchmarkAppendBytes(b, 1) 34 benchmarkAppendBytes(b, 1)
35 } 35 }
36 36
37 func BenchmarkAppend4Bytes(b *testing.B) { 37 func BenchmarkAppend4Bytes(b *testing.B) {
38 benchmarkAppendBytes(b, 4) 38 benchmarkAppendBytes(b, 4)
39 } 39 }
40 40
41 func BenchmarkAppend7Bytes(b *testing.B) {
42 benchmarkAppendBytes(b, 7)
43 }
44
41 func BenchmarkAppend8Bytes(b *testing.B) { 45 func BenchmarkAppend8Bytes(b *testing.B) {
42 benchmarkAppendBytes(b, 8) 46 benchmarkAppendBytes(b, 8)
43 } 47 }
44 48
49 func BenchmarkAppend15Bytes(b *testing.B) {
50 benchmarkAppendBytes(b, 15)
51 }
52
45 func BenchmarkAppend16Bytes(b *testing.B) { 53 func BenchmarkAppend16Bytes(b *testing.B) {
46 benchmarkAppendBytes(b, 16) 54 benchmarkAppendBytes(b, 16)
47 } 55 }
48 56
49 func BenchmarkAppend32Bytes(b *testing.B) { 57 func BenchmarkAppend32Bytes(b *testing.B) {
50 benchmarkAppendBytes(b, 32) 58 benchmarkAppendBytes(b, 32)
51 } 59 }
52 60
53 func benchmarkAppendStr(b *testing.B, str string) { 61 func benchmarkAppendStr(b *testing.B, str string) {
54 b.StopTimer() 62 b.StopTimer()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 122
115 func TestAppendOverlap(t *testing.T) { 123 func TestAppendOverlap(t *testing.T) {
116 x := []byte("1234") 124 x := []byte("1234")
117 x = append(x[1:], x...) // p > q in runtime·appendslice. 125 x = append(x[1:], x...) // p > q in runtime·appendslice.
118 got := string(x) 126 got := string(x)
119 want := "2341234" 127 want := "2341234"
120 if got != want { 128 if got != want {
121 t.Errorf("overlap failed: got %q want %q", got, want) 129 t.Errorf("overlap failed: got %q want %q", got, want)
122 } 130 }
123 } 131 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/runtime/arch_386.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b