@@ -86,7 +86,7 @@ the need to process custom output formats in future benchmarks.
86
86
87
87
## Proposal
88
88
89
- A Go benchmark data file is a textual file consisting of a sequence of lines.
89
+ A Go benchmark data file is a UTF-8 textual file consisting of a sequence of lines.
90
90
Configuration lines and benchmark result lines, described below,
91
91
have semantic meaning in the reporting of benchmark results.
92
92
@@ -102,13 +102,15 @@ A configuration line is a key-value pair of the form
102
102
103
103
key: value
104
104
105
- where key contains no space characters (as defined by ` unicode.IsSpace ` )
105
+ where key begins with a lower case character (as defined by ` unicode.IsLower ` ),
106
+ contains no space characters (as defined by ` unicode.IsSpace ` )
106
107
nor upper case characters (as defined by ` unicode.IsUpper ` ),
107
- and space characters separate “key:” from “value.”
108
+ and one or more ASCII space or tab characters separate “key:” from “value.”
108
109
Conventionally, multiword keys are written with the words
109
110
separated by hyphens, as in cpu-speed.
110
111
There are no restrictions on value, except that it cannot contain a newline character.
111
- Value can be omitted entirely but the colon must still be present.
112
+ Value can be omitted entirely, in which case the colon must still be
113
+ present, but need not be followed by a space.
112
114
113
115
The interpretation of a key/value pair is up to tooling, but the key/value pair
114
116
is considered to describe all benchmark results that follow,
@@ -125,7 +127,9 @@ so the line can be parsed with `strings.Fields`.
125
127
The line must have an even number of fields, and at least four.
126
128
127
129
The first field is the benchmark name, which must begin with ` Benchmark `
128
- and is typically followed by a capital letter, as in ` BenchmarkReverseString ` .
130
+ followed by an upper case character (as defined by ` unicode.IsUpper ` )
131
+ or the end of the field,
132
+ as in ` BenchmarkReverseString ` or just ` Benchmark ` .
129
133
Tools displaying benchmark data conventionally omit the ` Benchmark ` prefix.
130
134
The same benchmark name can appear on multiple result lines,
131
135
indicating that the benchmark was run multiple times.
@@ -287,7 +291,7 @@ anticipated future work on benchmark reporting.
287
291
288
292
The main known issue with the current ` go test -bench ` is that
289
293
we'd like to emit finer-grained detail about runs, for linearity testing
290
- and more robust statistics.
294
+ and more robust statistics (see [ issue 10669 ] ( https://golang.org/issue/10669 ) ) .
291
295
This proposal allows that by simply printing more result lines.
292
296
293
297
Another known issue is that we may want to add custom outputs
0 commit comments