-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
performanceMust go fasterMust go fasterregexmeow is a substring of homeownermeow is a substring of homeowner
Description
The NFA nodes of type _N_nop, _N_group and _N_end_group do not result in any changes to the match state in the matcher. However, processing them still requires some time. Going by the benchmarks in #5939, it seems about 2.5 ns are spent on my machine whenever when such a node is encountered by the matcher; see, e.g., the 37 % (relative) / 470 ns (absolute) increase in running time when matching the pattern (?:a)* to 100 a's compared to a*.
Note that these NFA nodes do usually serve some purpose during regex parsing, so resolving this issue requires some careful changes to the parser logic.
StephanTLavavej and frederick-vs-ja
Metadata
Metadata
Assignees
Labels
performanceMust go fasterMust go fasterregexmeow is a substring of homeownermeow is a substring of homeowner