Skip to content

Regex performance question #599

Answered by jszwedko
ptr1120 asked this question in Q&A
Dec 15, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote
  • Are regexes compiled and/or cached in Vector to enhance performance?

Regexes are, generally, compiled once at start-up. The only exception is the to_regex function which does it at run time.

  • If regexes are not inherently cached, is there a way to precompile them or store them in a compiled format using an enrichment_table or similar feature?

There is no caching, no, but again, static regexes are compiled upfront. #137 is tracking an enhancement to VRL to allow for caching within functions. If it existed, we'd take advantage of it with to_regex.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ptr1120
Comment options

Answer selected by ptr1120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants