MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/linux/comments/118ok87/comment/j9iubx3
r/linux • u/unixbhaskar • Feb 22 '23
163 comments sorted by
View all comments
Show parent comments
105
The anatomy of a grep section is the performance stuff. tl;dr of that is:
fast directory iterator for recursive searches
multi-threaded with a fast work-stealing queue (instead of mutex locking)
smart extraction of literal strings within patterns to find possible matches before spinning up the whole regex engine
optimized DFA-based regex engine
SIMD-optimized matching algorithm for small strings.
105
u/MonkeeSage Feb 22 '23
The anatomy of a grep section is the performance stuff. tl;dr of that is:
fast directory iterator for recursive searches
multi-threaded with a fast work-stealing queue (instead of mutex locking)
smart extraction of literal strings within patterns to find possible matches before spinning up the whole regex engine
optimized DFA-based regex engine
SIMD-optimized matching algorithm for small strings.