-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
performanceMatching time doesn't meet expectationsMatching time doesn't meet expectations
Description
As reported on the forums, a matcher a log line like this can have poor performance when failing to match:
[2025-09-01 12:34:56.789] [TRACE] [net.http] (1442) [email protected] | https://example.com | {"id": 42, "name": "Widget", "price": 12.50, "tags": ["swift","regex","benchmark"]} | let foo = 123; let bar = foo + 456 // sum | This is is a test with a repeated word word for backreference. | 0.0.0.0
The pattern in the post is written as RegexDSL, and translates to this pattern:
let logLine = #/
(?:
(?m:^)
\[
\d{4}-\d{2}-\d{2}
\s
\d{2}:\d{2}:\d{2}
\.
\d{3}
\] \[
(TRACE|DEBUG|INFO|WARN|ERROR)
\] \[
\w+
(?:\.\w+)*
\] \(
\d+
\)
\s+
[(?s:.)]*?
(?m:$)
){8}
/#
Metadata
Metadata
Assignees
Labels
performanceMatching time doesn't meet expectationsMatching time doesn't meet expectations