This repository was archived by the owner on Jul 7, 2023. It is now read-only.
This repository was archived by the owner on Jul 7, 2023. It is now read-only.
Analyze complexity before actual compile? #11
Closed
Description
Hi, I'm wondering if there exists a theoretical way to cheaply (ish?) analyze the resulting automaton complexity ahead of time, without actually building it.
My use case is that I have an opportunity to choose a pattern implementation dynamically, between a plain Regex
that is faster to compile but (in some cases) much slower to match, and an automaton, which seems to always be much faster to match against. It would be helpful to have such a measurement up front, in order to help pick the tradeoff. I know that the docs say no untrusted patterns, but the user does not write the pattern directly: The patterns are generated based on "wildcards" (*
) in search words.
If this sounds impossible, then so be it :)
Otherwise, thanks for a great lib!
Metadata
Metadata
Assignees
Labels
No labels