idx

idx vs grep Benchmark Report

Date: 2026-05-06
Repository: idx (self-benchmark in this repo)

Scope

This report compares search performance between:

Benchmark command used:

go test ./internal/core/services/search -run '^$' -bench '^BenchmarkSearchVsGrep$' -benchmem -count=3

Corpus profiles

Results (average of 3 runs)

Corpus Method ns/op (avg) ms/op B/op allocs/op
files-500 service 28,625 0.029 15,166 486
files-500 cli 8,379,099 8.38 14,555 43
files-500 grep 14,750,834 14.75 18,229 80
files-2000 service 115,375 0.115 60,562 1,910
files-2000 cli 18,603,417 18.60 14,784 43
files-2000 grep 55,202,165 55.20 18,796 80

Key comparisons

idx CLI vs grep

Allocations and memory

Interpretation

Notes and limitations

Reproduce

make bench-search-vs-grep
# or
go test ./internal/core/services/search -run '^$' -bench '^BenchmarkSearchVsGrep$' -benchmem -count=3