Skip to content

Commit 069b961

Browse files
rctcwyvrnmilseman
authored andcommitted
Remove some comments
1 parent 460cd35 commit 069b961

File tree

5 files changed

+6
-53
lines changed

5 files changed

+6
-53
lines changed

Sources/RegexBenchmark/Benchmark.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public protocol RegexBenchmark {
88

99
public struct Benchmark: RegexBenchmark {
1010
public let name: String
11-
let regex: Regex<Substring> // need to figure out this type to allow for other regexes
11+
let regex: Regex<Substring>
1212
let ty: MatchType
1313
let target: String
1414

@@ -72,22 +72,13 @@ public struct BenchmarkRunner {
7272
suite.append(new)
7373
}
7474

75-
// requires the macos13 beta
76-
// public func measure() -> Duration {
77-
// let clock = SuspendingClock()
78-
// var times = (0..<samples).map { _ in clock.measure(run) }
79-
// assert(times.count == samples)
80-
//
81-
// times.sort()
82-
// return times[samples/2]
83-
// }
84-
8575
func measure(benchmark: some RegexBenchmark) -> Time {
8676
var times: [Time] = []
8777

8878
// initial run to make sure the regex has been compiled
8979
benchmark.run()
9080

81+
// fixme: use suspendingclock?
9182
for _ in 0..<samples {
9283
let start = Tick.now
9384
benchmark.run()

Sources/RegexBenchmark/Utils/Size.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
//===----------------------------------------------------------------------===//
2-
//
3-
// This source file is part of the Swift Collections open source project
4-
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
6-
// Licensed under Apache License v2.0 with Runtime Library Exception
7-
//
8-
// See https://swift.org/LICENSE.txt for license information
9-
//
10-
//===----------------------------------------------------------------------===//
11-
1+
// Taken from swift-collections-benchmark
122
import ArgumentParser
133

144
public struct Size: RawRepresentable {

Sources/RegexBenchmark/Utils/Tick.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
//===----------------------------------------------------------------------===//
2-
//
3-
// This source file is part of the Swift Collections open source project
4-
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
6-
// Licensed under Apache License v2.0 with Runtime Library Exception
7-
//
8-
// See https://swift.org/LICENSE.txt for license information
9-
//
10-
//===----------------------------------------------------------------------===//
11-
1+
// Taken from swift-collections-benchmark
122
#if !USE_FOUNDATION_DATE && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
133
import Foundation // For the side effect of reexporting Darwin/Glibc
144

Sources/RegexBenchmark/Utils/Time.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
//===----------------------------------------------------------------------===//
2-
//
3-
// This source file is part of the Swift Collections open source project
4-
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
6-
// Licensed under Apache License v2.0 with Runtime Library Exception
7-
//
8-
// See https://swift.org/LICENSE.txt for license information
9-
//
10-
//===----------------------------------------------------------------------===//
1+
// Taken from swift-collections-benchmark
112

123
import Foundation
134
import ArgumentParser

Sources/RegexBenchmark/Utils/Timer.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
//===----------------------------------------------------------------------===//
2-
//
3-
// This source file is part of the Swift Collections open source project
4-
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
6-
// Licensed under Apache License v2.0 with Runtime Library Exception
7-
//
8-
// See https://swift.org/LICENSE.txt for license information
9-
//
10-
//===----------------------------------------------------------------------===//
1+
// Taken from swift-collections-benchmark
112

123
public struct Timer {
134
internal var _expectNested: Bool? = nil

0 commit comments

Comments
 (0)