3 ms·
How is hound better than ag [1]? [1] https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher
by quanticle 12y ago
How is hound better than ag [1]?
[1] https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher
- kellegous 12y agoThe biggest difference is that Hound uses an inverted index to support regular expression searches. This is a technique borrowed from the original Google Code Search. The details are discussed on Russ Cox's site (http://swtch.com/~rsc/regexp/regexp4.html http://swtch.com/~rsc/regexp/regexp4.html). With this technique, you can generally avoid even opening the vast majority of the files you are "grepping" (the number obviously depends on the pattern). To give you a sense, I just searched for a particular method name in several repositories totally several 100k of files and the search only had to open and search 9 files.
- quanticle 12y agoThanks for the explanation. I guess I missed the part that said that Hound is indexed search rather than straight file search.