12/17/2023 0 Comments Grep recursive text files directory![]() ![]() Need to iterate directories multi-threaded. std::filesystem::recursive_directory_iterator in a single thread is not the answer.Words starting with alphabetic characters followed by at least 2 digits hg -nw '+d"Īny E-mail address hg -w the number of HEX values hg -cw "(?:0x)?+" The following searches are performed on the entire Apple Swift source tree. Regex with Literal Suffix hg -nw '+_SUSPEND' Simple Literal (case insensitive) hg -niw 'PM_RESUME' The following searches are performed on the entire Linux kernel source tree (after running make defconfig & make -j8). Words surrounding a literal string hg -n 'w++Holmes+w+' en.txt Simple Literal (case insensitive) hg -inw 'Sherlock Holmes' en.txt Simple Literal hg -nw 'Sherlock Holmes' en.txt Literal with Regex Suffix hg -nw 'Sherlock w+' en.txt RegexĬount number of times Holmes did something hg -c 'Holmes did w' The following searches are performed on a single large file cached in memory (~13GB, .gz). Performance Single Large File Search: .txt You can see them on GitHub.ĮDIT (2023.06.08, 8:18am CDT, UTC-5): I've updated the benchmark results on GitHub - using ripgrep v13.0.0 instead of 11.0.2. NOTE: I had to remove some rows in the table since Reddit markdown formatting was being weird. I was really interested in seeing how far I could go compared to the state-of-the-art today ( ripgrep, ugrep, The Silver Searcher etc.). I've spent the last few months implementing a grep for fun in C++. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |