mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-26 01:31:57 -07:00
grep-regex: add fast path for -w/--word-regexp
Previously, ripgrep would always defer to the regex engine's capturing matches in order to implement word matching. Namely, ripgrep would determine the correct match offsets via a capturing group, since the word regex is itself generated from the user supplied regex. Unfortunately, the regex engine's capturing mode is still fairly slow, so this commit adds a fast path to avoid capturing mode in the vast majority of cases. See comments in the code for details.
This commit is contained in:
@@ -12,6 +12,8 @@ Performance improvements:
|
||||
of ` `.
|
||||
* PERF:
|
||||
Improve literal detection when the `-w/--word-regexp` flag is used.
|
||||
* PERF:
|
||||
Improve overall performance of the `-w/--word-regexp` flag.
|
||||
|
||||
Feature enhancements:
|
||||
|
||||
|
Reference in New Issue
Block a user