File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ extension BenchmarkRunner {
3232
3333 self . addURLWithWordBoundaries ( )
3434 self . addFSPathsRegex ( )
35+
36+ // Register community benchmarks
37+ self . addCommunityBenchmark_sspringerURL ( )
38+
3539 // -- end of registrations --
3640 }
3741}
Original file line number Diff line number Diff line change @@ -22,5 +22,33 @@ extension BenchmarkRunner {
2222 )
2323 url. register ( & self )
2424 }
25+
26+ // Benchmark from forums user @sspringer
27+ // https://github.com/stefanspringer1/SwiftRegexBenchmarks/tree/main
28+ mutating func addCommunityBenchmark_sspringerURL( ) {
29+ let urlRegex = #"https?:\/\/([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w\.-]*)*\/?"#
30+ let rawData = """
31+ URLs:
32+ http://www.google.com
33+ https://www.google.com
34+ http://google.com
35+ https://google.com
36+ http://www.google.com/
37+ https://www.google.com/
38+ http://google.com/
39+ https://google.com/
40+ http://www.google.com/index.html
41+ https://www.google.com/index.html
42+ http://google.com/index.html
43+ https://google.com/index.html
44+ """
45+ let data = String ( repeating: rawData, count: 100 )
46+ let url = CrossBenchmark (
47+ baseName: " Community_sspringerURL " ,
48+ regex: urlRegex,
49+ input: data
50+ )
51+ url. register ( & self )
52+ }
2553}
2654
You can’t perform that action at this time.
0 commit comments