regex: avoid using literal optimizations when whitespace is detected

If a literal is entirely whitespace, then it's quite likely that it is
very common. So when that case occurs, just don't do (inner) literal
optimizations at all.

The regex engine may still make sub-optimal decisions here, but that's a
problem for another day.

Fixes #1087
This commit is contained in:
Andrew Gallant
2020-03-15 12:01:42 -04:00
parent 9dd4bf8d7f
commit e772a95b58
3 changed files with 30 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ Deprecations:
Performance improvements:
* [PERF #1087](https://github.com/BurntSushi/ripgrep/pull/1087):
ripgrep is smarter when detected literals are whitespace.
* [PERF #1381](https://github.com/BurntSushi/ripgrep/pull/1381):
Directory traversal is sped up with speculative ignore-file existence checks.
* [PERF cd8ec38a](https://github.com/BurntSushi/ripgrep/commit/cd8ec38a):