Ripgrep searches source trees very fast
Summary
Andrew Gallant develops a recursive search tool that combines Rust, parallel directory traversal and efficient regex engines. Ripgrep is written in Rust. The project is free software.
Ideas
- Ripgrep respects rules from .gitignore by default.
- Parallel directory work uses several cores.
- Memory mapping reduces copying for suitable files.
- Binary file detection prevents unreadable standard output.
Insights
- Good defaults improve safety and speed at the same time.
- System tools gain more from well-matched libraries than from individual tricks.
- Benchmarks need varied file trees and search patterns.
Facts
- The command is called rg.
Recommendations
- Use fixed strings when regular expressions are not needed.
- Check the ignore rules when matches seem to be missing.
References
Links to the original source and the Web Archive open in a new tab.