bk99.de entertain the web since 1997

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

Read the original article

Search the Web Archive