top | item 33310812

(no title)

leakbang | 3 years ago

I did notice that ripgrep was noticeably faster than grep, however, I'm looking for a solution that searches through the source code as I type. Something like Fsearch but for searching through source code contents.

I think for something like this even grep would be fast enough.

discuss

order

burntsushi|3 years ago

You still haven't specified your corpus size, despite me noting how crucial it was to your question.

You also haven't specified what kinds of queries you're running. If you're doing simple literal queries like 'rg foobar', then ripgrep is pretty much as fast as you're going to get when it comes to non-indexed search. It uses all your CPU cores. On Intel x86_64, it uses AVX2 to do the substring search for 'foobar'. There's just not much you can do to go faster than that in terms of latency.

As I said, if you have a large corpus, then the only way to get instant search times is through an index. You haven't said why those approaches don't work for you.

> I think for something like this even grep would be fast enough.

Sorry I should have mentioned this before, but I'm the author of ripgrep. I know a thing or two about how fast normal exhaustive search greps can go. :-)

leakbang|3 years ago

I'm querying through ~600k lines of code. Ripgrep is very noticeably faster than grep when I'm searching. I have no complaints at all regarding the speed!

The only issue I'm facing is that I wish for Ripgrep to display me the search results as I type. Similar to how FSearch does it.

So instead of typing a search query and hitting enter in the commandline, I would want to continuously search as I type. I think since Ripgrep is very fast, it would be amazing for this task.