Repository navigation
The idea how to work on stale indices #129
Alexander Ulitin (ulex)
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey, this is an awesome project. Thanks for it! I've wanted something similar for a long time. I work in a huge monorepo with about one million files. Ripgrep is quite slow in it.
I see that tgrep currently relies on the index as the source of truth if one is present.
To address the second point, I would like to suggest a strategy that would always yield correct results. If the index will be enriched with the modification stamp of the file at the time of its creation, the index could help eliminate false negative errors.
In other words, we would need to traverse the file system and collect modification stamps for all files. However, we would only need to search files that were changed or that have hits according to the index. This could improve performance by avoiding the scanning of files that definitely do not contain the search patterns. However, this assumes that the modification stamp always changes when the file is modified, which is not technically true, though most software relies on this heuristic.
I created a prototype of this index three years ago at a hackathon. However, I was unable to release it as a product. Funny enough, it has the same name: tgrep.
https://github.com/ulex/tgrep
Oh, I forgot about the motivation part! I don't want to manage indexes for my working trees. The current scheme requires me to run a daemon for each one. However, I often need to use grep spontaneously. I don't want to spawn a process for each working tree and monitor its health.
All reactions