GrepTurbo builds a local trigram index over your codebase so regex queries skip irrelevant files entirely — instead of scanning every byte like
grep. The bigger your codebase, the bigger the win.
Tested on the Go standard library source (~10,000 files):
| Tool | Time | Files Scanned |
|---|---|---|
grep -rn |
2.4 – 3.1s | All 10,000 |
GrepTurbo search |
0.4 – 0.9s | ~50 candidates |
6–7x faster on 10k files. Grows with codebase size. Repeated queries get faster as the OS caches the mmap'd index in the page cache.
curl -fsSL https://yanurag-dev.github.io/GrepTurbo/install.sh | bashgrepturbo init
(no flags — sets up in current directory)
grepturbo build
-root <dir> Directory to index (default: .)
-out <dir> Where to write the index (default: .grepturbo)
grepturbo <pattern>
-index <dir> Index directory to query (default: .grepturbo)
Step 1 — initialize (one-time setup for your IDE/editor):
grepturbo initThis sets up GrepTurbo integration so your editor can run searches. Creates .grepturbo/ in the project root.
Step 2 — build the index (once per project, or when files change):
grepturbo build -root ./myproject -out .grepturboWalks your codebase, extracts trigrams from each file, builds the inverted index, and writes 3 files to disk:
lookup.idx— hash table (mmap'd for fast queries)postings.dat— trigram → file IDsfiles.idx— file ID → path mapping
Step 3 — search:
# Full syntax
grepturbo search -index .grepturbo 'func.*Error'
# Shorthand (equivalent)
grepturbo 'func.*Error'Output is file:line:text, same as grep -n:
internal/index/reader.go:25:func NewReader(dir string) (*Reader, error) {
internal/query/search.go:26:func Search(r *index.Reader, pattern string) ([]Match, error) {
