Skip to content

Commit

Permalink
fix(benchmark): fix benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed Apr 1, 2024
1 parent a4013e1 commit 76ed255
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Benchmarks/Benchmarks/MyBenchmark/MyBenchmark.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Benchmark
import Tokenizer
private import Benchmark
private import Collections
private import Tokenizer

private struct TestSink {}

Expand Down Expand Up @@ -31,8 +32,8 @@ let benchmarks = {
) { benchmark in
for _ in benchmark.scaledIterations {
var tokenizer = Tokenizer(sink: TestSink())
var iter = html.makeIterator()
tokenizer.tokenize(&iter)
var input = Deque(html)
tokenizer.tokenize(&input)
}
}
}
9 changes: 9 additions & 0 deletions Benchmarks/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
"version" : "1.2.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ let package = Package(
swiftSettings: [
.unsafeFlags(["-Xfrontend", "-warn-long-function-bodies=100"], .when(configuration: .debug)),
.unsafeFlags(["-Xfrontend", "-warn-long-expression-type-checking=100"], .when(configuration: .debug)),
.unsafeFlags(["-swift-version", "6"]),
],
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
]
)
]
],
swiftLanguageVersions: [.version("6")]
)

0 comments on commit 76ed255

Please sign in to comment.