Skip to content

Commit

Permalink
Add 'perf' feature flag on regex crate
Browse files Browse the repository at this point in the history
Our grok crate is unusual. We use regex in certain places like date parsing and
onig when dealing with the grok patterns themselves. Work on #11206 strongly
suggests that if sinks are allowed to run less subject to slow receiver issue
then `apply_date_filter` is a CPU hotspot. As suggested by @tobz we enable the
'perf' flags to the regex crate, which features heavily in the implementation of
that function.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
  • Loading branch information
blt committed Feb 8, 2022
1 parent 2e19f61 commit 06662f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/grok/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ once_cell = { version = "1.9", default-features = false, features = ["std", "par
onig = { version = "6.3", default-features = false }
ordered-float = { version = "2", default-features = false }
peeking_take_while = { version = "1.0.0", default-features = false }
regex = { version = "1", default-features = false }
regex = { version = "1.5", default-features = false, features = ["perf"] }
serde = { version = "1.0.136", default-features = false }
serde_json = { version = "1.0.78", default-features = false }
strum_macros = { version = "0.23", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion lib/vrl/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exitcode = "1"
indoc = "1.0.3"
lazy_static = { version = "1", optional = true }
prettytable-rs = { version = "0.8", default-features = false, optional = true }
regex = { version = "1", default-features = false, optional = true }
regex = { version = "1", default-features = false, optional = true, features = ["perf"] }
rustyline = { version = "9", default-features = false, optional = true }
serde_json = "1"
structopt = { version = "0.3", default-features = false }
Expand Down

0 comments on commit 06662f4

Please sign in to comment.