Skip to content

Commit 5667705

Browse files
committed
[benchmark] Hangul Syllable finding benchmark
1 parent 03fe8d6 commit 5667705

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/RegexBenchmark/CLI.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct Runner: ParsableCommand {
1717
benchmark.addCSS()
1818
benchmark.addNotFound()
1919
benchmark.addGraphemeBreak()
20+
benchmark.addHangulSyllable()
2021
return benchmark
2122
}
2223
mutating func run() throws {

Sources/RegexBenchmark/Suite/GraphemeBreak.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,14 @@ extension BenchmarkRunner {
1212
baseName: "GraphemeBreakNoCap", regex: regex, input: input)
1313
benchmark.register(&self)
1414
}
15+
16+
mutating func addHangulSyllable() {
17+
let input = Inputs.graphemeBreakData
18+
let regex = #"HANGUL SYLLABLE [A-Z]+(?:\.\.HANGUL SYLLABLE [A-Z]+)?"#
19+
20+
let benchmark = CrossBenchmark(
21+
baseName: "HangulSyllable", regex: regex, input: input)
22+
benchmark.register(&self)
23+
}
1524
}
1625

0 commit comments

Comments
 (0)