Skip to content

why does RegexSet go slower as more patterns are added? #881

Answered by BurntSushi
Guillermogsjc asked this question in Q&A
Discussion options

You must be logged in to vote

Without a reproduction I can't really answer your question. :-/

If you search the issue tracker for RegexSet, you'll likely see that its performance can be somewhat variable.

Without a reproduction, all I can do is say something very generic. Namely, like virtually anything that does optimizations, there are thresholds everywhere. Thresholds, for example, might dictate when one regex engine is used in place of another. Those thresholds are often determined through a combination of "what makes sense" and what has been empirically observed in at least some cases. But those thresholds may not be correct in all cases. Sometimes they can be tweaked, but it will often just make some other case …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Guillermogsjc
Comment options

@BurntSushi
Comment options

Answer selected by BurntSushi
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