You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: benchmark/Naming.md
+19-13Lines changed: 19 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -33,20 +33,22 @@ benchmark is testing individual method on a concrete type.
33
33
````
34
34
35
35
Benchmark names are used to run individual tests when passed as command line
36
-
arguments to the benchmark driver. Special characters that could be interpreted
37
-
by the shell would require quoting. Stick to ASCII letters, numbers and period.
36
+
arguments to the benchmark driver. Stick to ASCII letters, numbers and period.
38
37
Exceptionally:
39
38
40
39
* Use **`-`** only to denote control flow constructs like `for-in` or `if-let`.
41
-
* Use **`!`** and **`?`** for optional types, conditional or forced downcasting
42
-
and optional chaining.
40
+
* Use **`!`** and **`?`** for optional types, conditional or forced downcasting,
41
+
optional chaining etc.
43
42
44
43
````
45
-
✅ OCB.NSArray.AnyObject.as?.Array.NSString
46
-
✅ OCB.NSArray.AnyObject.as!.Array.String
47
44
✅ Array.append.Array.Int?
48
45
✅ Flatten.Array.Tuple4.for-in.reserved
46
+
✅ OCB.NSArray.as!.Array.NSString
49
47
````
48
+
49
+
Note: Special characters that could be interpreted by the shell require escaping
50
+
(`\!`) or quoting the name, when running such benchmarks individually.
51
+
50
52
</details><p><!-- spacer --></p></li>
51
53
<li>
52
54
<strong>Use groups and variants</strong> to structure the benchmark family by
@@ -56,7 +58,10 @@ differently sized variants.
56
58
<details>
57
59
58
60
Benchmarks in a family can be grouped by the tested operation, method or varied
59
-
by types and different workload sizes. It might be necessary to abbreviate some names to fit the size limit, based on the longest combination. Choose consistent names for the components throughout all members in the family, to allow for relative comparison across the different axis of variation.
61
+
by types and different workload sizes. It might be necessary to abbreviate some
62
+
names to fit the size limit, based on the longest combination. Choose consistent
63
+
names for the components throughout all members in the family, to allow for
64
+
relative comparison across the different axis of variation.
60
65
61
66
````
62
67
✅ Seq.dropFirst.Array
@@ -106,7 +111,7 @@ There's no need to be literal with type names. **Be descriptive**:
106
111
107
112
</details><p><!-- spacer --></p></li>
108
113
<li>
109
-
<strong>Keep it short.</strong> 40 characters at most. Abbreviate if necessary!
114
+
<strong>Keep it short.</strong> 40 characters at most. Abbreviate if necessary.
110
115
<details>
111
116
112
117
Benchmarking results are reported on GitHub and very long names are causing
@@ -117,7 +122,7 @@ unique and short, than overly descriptive.*
117
122
118
123
Prefer concise names for potential benchmark family extensions. Leave out the
119
124
nested types from variants if they aren't strictly necessary for disambiguation.
120
-
If there's potentially valuable future variant, like testing `ContinuousArray`,
125
+
If there's potentially valuable future variant, like testing `ContiguousArray`,
121
126
keep the `Array` now, allowing for addition of `ContArr` variants later.
122
127
123
128
Use **`Val`** and **`Ref`** as short descriptors for variants that compare value
@@ -129,12 +134,13 @@ language prefix/suffix when necessary (`ASCIIChar`). For benchmarks that measure
129
134
[two letter codes](https://en.wikipedia.org/wiki/ISO_639-1) instead of spelling
130
135
out the whole language names.
131
136
132
-
In a pinch, even C-style naming with two letter prefixes `OC` (for Objective-C)
133
-
or abbreviations like `Str` and `Arr` are OK, if it helps to fit a system with
134
-
descriptive names into 40 characters:
137
+
*In a pinch*, it's OK to use short C-style naming prefixes like `OCB` (for
138
+
Objective-C Bridging) or consistent abbreviations in the benchmark family like
139
+
`Str` and `Arr`, but *only if* it helps to fit a system with descriptive
0 commit comments