@@ -26,18 +26,18 @@ public enum BenchmarkCategory : String {
2626 case runtime, refcount, metadata
2727 // Other general areas of compiled code validation.
2828 case abstraction, safetychecks, exceptions, bridging, concurrency
29-
29+
3030 // Algorithms are "micro" that test some well-known algorithm in isolation:
3131 // sorting, searching, hashing, fibonaci, crypto, etc.
3232 case algorithm
33-
33+
3434 // Miniapplications are contrived to mimic some subset of application behavior
3535 // in a way that can be easily measured. They are larger than micro-benchmarks,
3636 // combining multiple APIs, data structures, or algorithms. This includes small
3737 // standardized benchmarks, pieces of real applications that have been extracted
3838 // into a benchmark, important functionality like JSON parsing, etc.
3939 case miniapplication
40-
40+
4141 // Regression benchmarks is a catch-all for less important "micro"
4242 // benchmarks. This could be a random piece of code that was attached to a bug
4343 // report. We want to make sure the optimizer as a whole continues to handle
@@ -46,12 +46,12 @@ public enum BenchmarkCategory : String {
4646 // as highly as "validation" benchmarks and likely won't be the subject of
4747 // future investigation unless they significantly regress.
4848 case regression
49-
49+
5050 // Most benchmarks are assumed to be "stable" and will be regularly tracked at
5151 // each commit. A handful may be marked unstable if continually tracking them is
5252 // counterproductive.
5353 case unstable
54-
54+
5555 // CPU benchmarks represent instrinsic Swift performance. They are useful for
5656 // measuring a fully baked Swift implementation across different platforms and
5757 // hardware. The benchmark should also be reasonably applicable to real Swift
@@ -151,16 +151,20 @@ public struct BenchmarkInfo {
151151 return _tearDownFunction
152152 }
153153
154+ public var legacyFactor : Int ?
155+
154156 public init ( name: String , runFunction: @escaping ( Int ) -> ( ) , tags: [ BenchmarkCategory ] ,
155157 setUpFunction: ( ( ) -> ( ) ) ? = nil ,
156158 tearDownFunction: ( ( ) -> ( ) ) ? = nil ,
157- unsupportedPlatforms: BenchmarkPlatformSet = [ ] ) {
159+ unsupportedPlatforms: BenchmarkPlatformSet = [ ] ,
160+ legacyFactor: Int ? = nil ) {
158161 self . name = name
159162 self . _runFunction = runFunction
160163 self . tags = Set ( tags)
161164 self . _setUpFunction = setUpFunction
162165 self . _tearDownFunction = tearDownFunction
163166 self . unsupportedPlatforms = unsupportedPlatforms
167+ self . legacyFactor = legacyFactor
164168 }
165169
166170 /// Returns true if this benchmark should be run on the current platform.
@@ -266,4 +270,3 @@ public func getString(_ s: String) -> String { return s }
266270// The same for Substring.
267271@inline ( never)
268272public func getSubstring( _ s: Substring ) -> Substring { return s }
269-
0 commit comments