mrkeyoor.com_
Tue 08 Sept 18:41 UTC
Dev Toolsevaluationupdated 08 Sept 2026

tgrep review

tgrep is a Rust search tool that builds a trigram index so repeated regex searches do not have to scan an entire large repository each time. It runs a local TCP server, keeps the index updated as files change, and is aimed at codebases where ordinary grep-style rescanning has become a noticeable delay.

trackingstars / 7d
Verdict

Our build finished in 29 seconds, and all 1,618 tests passed in 71 seconds, unusually convincing results for a young v1.0.4 developer tool. Use tgrep when repeated search latency in a genuinely large repository is a daily cost and running a local index service is acceptable. Stay with ripgrep for smaller trees or occasional searches, because tgrep earns its complexity only when reuse of the index matters.

We ran it

Install✓ · 19s83 packages
Build✓ · 29s
Tests✓ · 71s1618 passed · 0 failed of 1618 (cargo test)
Repo95 files~45,965 lines of source · 1.9 MB · 16 CI workflows

Answers from our run

Does tgrep build from source?

Dependencies installed in 19 seconds (83 packages), and the build succeeded in 29 seconds. We cloned commit 10c7388 into a clean Debian container with 3 CPUs and no project-specific setup.

Do tgrep's tests pass?

Yes: 1618 of 1618 passed when we ran the project's own test command (cargo test). Some failures need services or credentials a bare container does not have.

Who should not use tgrep?

Small-repository users, because ripgrep is simpler and indexing may save little

What are the alternatives to tgrep?

ripgrep, The Silver Searcher, livegrep. Our build finished in 29 seconds, and all 1,618 tests passed in 71 seconds, unusually convincing results for a young v1.

Setup4/5Built cleanly, but indexing and a server add two operational steps
Docs5/5Clear commands, architecture, caveats, and benchmark methodology
Community3/51,815 stars and fresh activity, but still a young project
Maturity4/5v1.0.4, 1,618 passing tests, and a real CLI integration

Who it’s for

Developers searching the same 100k-plus-file monorepo throughout the day
Teams that can keep a local indexing server running beside their checkout
GitHub Copilot CLI users who want to understand the search engine integrated there
Rust-friendly toolsmiths who value a small, tested native binary

Who it’s NOT for

Small-repository users, because ripgrep is simpler and indexing may save little
People who need a stateless command with no server or stored index
Environments that prohibit local TCP services or persistent index files
Workloads dominated by huge result sets, where output delivery can erase the index advantage

Setup reality

In our sandbox, installation succeeded in 19 seconds with 83 packages installed, the build succeeded in 29 seconds, and cargo test completed in 71 seconds with all 1,618 tests passing. That is strong evidence that the Rust project builds cleanly in a fresh Debian container, but real use still has more moving parts than a drop-in grep command: you build an index, start a server, and let its watcher maintain state. The README makes those steps clear, and our run found no missing system-package surprise.

tgrep trades one full scan for a maintained index

tgrep addresses a specific problem: repeated regex searches become expensive when a repository contains 100,000 or more files. A conventional tool such as ripgrep walks and scans the relevant files for every query. tgrep instead extracts trigrams, stores an index, and narrows each search to files that could contain the pattern. That trade is sensible only when the same working tree is searched often enough to repay the initial indexing cost.

The project packages that index behind a local TCP server using newline-delimited JSON-RPC 2.0. A client sends the pattern to tgrep serve, while a file watcher updates an in-memory overlay as the checkout changes. The pitch is therefore not simply "grep, but faster." It is a persistent local search service with a grep-shaped command line, and users should judge the extra process and disk state alongside the speed claims.

Our clean-room run passed every test

We cloned commit 10c7388 into an unprivileged Debian sandbox with 3 CPUs and 12 GB of RAM. Installation succeeded in 19 seconds and installed 83 packages. The repository occupied about 1.9 MB, contained 95 files, and had roughly 45,965 lines of source. Those figures describe our box and checkout, not a general performance promise.

The build then succeeded in 29 seconds. cargo test completed in 71 seconds with 1,618 passed and 0 failed. That is an excellent first-contact result: no undocumented system dependency stopped the build, and no test needed secrets or privileged access. We also found 16 CI workflow files, no Dockerfile, and no separate tests directory, so much of the coverage appears to live within the Rust project structure rather than a top-level integration suite.

Our run did not reproduce the project's search benchmarks, so its reported speedups should remain labeled as project results. The README reports wins in 17 of 18 measured cells, ranging from 3.81x for Chromium on Linux to 51.9x for Gecko on macOS arm64. It also discloses the exception, Kubernetes on Linux at 0.93x, which makes the performance presentation more credible than a single best-case chart.

The architecture is unusually explicit for v1.0.4

The strongest design detail is the hybrid index. An mmap-backed IndexReader handles stable on-disk postings, while LiveIndex holds newly changed or still-indexing files in memory. HybridIndex merges them with the overlay taking precedence. Background work runs in parallel batches of 500 files, and queries can use partial data before the complete build finishes, which reduces the operational pain of starting on a large tree.

Memory management is also treated as a first-class constraint. tgrep flushes after 50,000 files or 5 minutes, swaps the reader, and keeps the overlay bounded. The README distinguishes private memory from file-backed working set and gives a 64 MiB default file-size cap, removable with --no-max-filesize. These details matter because an indexing tool can otherwise move latency out of sight while quietly consuming unreasonable RAM.

File selection shows similar care. More than 50 binary formats are rejected by extension, an 8 KB content check catches additional binaries, and ignore handling accounts for Git's core.ignorecase behavior. For directories without .git, tgrep warns that .gitignore is inactive and offers --no-require-git. That is the sort of rough edge many tools leave users to diagnose through an unexpectedly huge index.

The costs are state, scope, and a young ecosystem

The main weakness is operational, not algorithmic. Users must create an index, run a server, keep a local TCP endpoint available, and trust the watcher to reflect ongoing edits. The 50,000-file or 5-minute flush policy is reasonable, but it is still state that ordinary ripgrep does not have. Teams with ephemeral containers, locked-down desktops, or many short-lived checkouts may spend more effort managing the index than they recover in query time.

Indexed search also cannot eliminate every cost. The project itself says queries returning tens of thousands of matches spend substantial time delivering results, and its own table includes a 0.93x loss. Trigrams are most useful for selective patterns over very large corpora, not as a universal guarantee. The 64 MiB cap can exclude unusually large sources unless consciously disabled, while disabling it changes the resource profile users originally accepted.

Current activity is healthy, but history is short

The repository had 1,815 stars and only 5 open issues in the supplied snapshot. Its latest release, v1.0.4, arrived on September 7, 2026, and the last push was September 8, 2026. Taken together, the fresh push, fresh release, small issue queue, and 16 workflow files point to active maintenance rather than a project coasting on an old tag.

Still, popularity is not the same as a long compatibility record. v1.0.4 is early enough that cautious organizations should pin the version and test index behavior on their own largest repositories. Integration into GitHub Copilot CLI is meaningful real-world validation, but the evidence provided does not tell us how quickly maintainers answer issues or whether the TCP protocol has stability guarantees for third-party clients.

It belongs beside developer checkouts, not at the center of a platform

In a practical stack, tgrep fits on a developer workstation or persistent coding environment where one huge checkout receives dozens of searches per hour. Let Git remain the source of truth, run tgrep serve beside the working tree, and retain ripgrep as the stateless fallback. For shared web search across many repositories, livegrep or Zoekt is a more natural service boundary; for a 16,000-file project, ordinary ripgrep may already feel instant.

The decision is ultimately easy to test with real work. If repeated scans of a 100,000-file tree interrupt thought, tgrep's maintained index and immediate partial serving are worth trying. If searches are sporadic, results are enormous, or background services are unwelcome, the simpler tool wins. Our 29-second build and 1,618 clean tests make experimentation low-risk, while the architecture gives serious users enough detail to understand the trade they are making.

Alternatives

ProjectWhat it isPick it when
ripgrep gh↗The established fast recursive search tool with no persistent server or prebuilt index.pick this instead when repositories are modest, searches are occasional, or operational simplicity matters most.
The Silver SearcherA familiar code-search command that recursively scans files and respects common ignores.pick this instead when you want a lightweight grep replacement and do not need an indexing daemon.
livegrepAn indexed code-search service designed for shared, browser-based exploration of repositories.pick this instead when search should be hosted centrally and exposed through a web interface.
ZoektA trigram-based indexed search engine built for fast search across many repositories.pick this instead when you need a broader code-search backend rather than a local grep-like workflow.

What people are saying

  1. [github-trending] microsoft/tgrep

Sources

  1. microsoft/tgrep on GitHub
  2. tgrep benchmark methodology and results
  3. tgrep v1.0.4 release

More dev tools reviews

open-source-mac-os-apps · buildkit · validator · teamai-cli · rustlings · zstd · the whole board →