How FZF and ripgrep improved my workflow
71–80 of 89 posts
Re: How FZF and ripgrep improved my workflow
#72This looks interesting and I'm going to play with it, but if you still still pipe PS into grep before killing, 'pkill -f' will do exactly what you want 80% of the time.
Re: How FZF and ripgrep improved my workflow
#73> It performs amazing even in a larger code base. Doubt ripgrep it will beat indexing, line GNU id-utils. (mkid to build ID file, lid to query). If you're using git, "git grep" is useful; it searches only files indexed in git, which provides a useful speedup.
Does it provide the same user experience? i.e., Does it keep the index up to date for you automatically? If so, that's something a lot of users aren't willing to pay for.
If you want a pre-indexed solution, I'd recommend checking out qgrep instead: https://zeux.io/2019/04/20/qgrep-internals/
> If you're using git, "git grep" is useful; it searches only files indexed in git, which provides a useful speedup.
Depends on what you're searching. In a checkout of the Linux kernel:
$ time LC_ALL=C git grep -E '[A-Z]+_SUSPEND' | wc -l
3707
real 1.033
user 5.769
sys 0.592
maxmem 63 MB
faults 0
real 1.033
user 0.000
sys 0.008
maxmem 9 MB
faults 0
$ time LC_ALL=en_US.UTF-8 git grep -E '[A-Z]+_SUSPEND' | wc -l
3707
real 3.624
user 21.910
sys 0.404
maxmem 64 MB
faults 0
real 3.623
user 0.000
sys 0.008
maxmem 9 MB
faults 0
$ time rg '[A-Z]+_SUSPEND' | wc -l
3707
real 0.138
user 0.767
sys 0.704
maxmem 21 MB
faults 0
real 0.138
user 0.003
sys 0.006
maxmem 9 MB
faults 0
This is even despite the fact that `git grep` already has a file index (ripgrep
has to process the >200 `.gitignore` files in the Linux repo for every search)
and the fact that `git grep` is also using parallelism.Re: How FZF and ripgrep improved my workflow
#74Earlier quoted context omitted.
I did an extensive comparison a while ago: https://blog.burntsushi.net/ripgrep/ --- It should still largely be pretty accurate (and ripgrep has only gotten faster). More generally, if someone can find a non-trivial example of ag being faster then ripgrep, then I'd love to have a bug report. (Where non-trivial probably means something like "not I/O bound" and "not so short that the differences are human imperceptible…
I'm currently working on a searcher on my own: https://github.com/elsamuko/fsrc When I started, I didn't know ripgrep, now I use it as reference. Of course it's still slower for regex searches and it has less options, but in some cases (e.g. simple string matching search), it is faster than rg (PM_RESUME in 160-170ms), mostly thanks to mischasan's fast strstr: https://mischasan.wordpress.com/2011/07/16/convergence-ss…
I would also caution you to make sure you're benchmarking equivalent workloads.
Re: How FZF and ripgrep improved my workflow
#75Earlier quoted context omitted.
I'm currently working on a searcher on my own: https://github.com/elsamuko/fsrc When I started, I didn't know ripgrep, now I use it as reference. Of course it's still slower for regex searches and it has less options, but in some cases (e.g. simple string matching search), it is faster than rg (PM_RESUME in 160-170ms), mostly thanks to mischasan's fast strstr: https://mischasan.wordpress.com/2011/07/16/convergence-ss…
I don't see any build instructions, so I don't know how to try it. Sorry. I did run `./scripts/build_boost.sh`, but that didn't produce any `fsrc` binary that I could use. I would also caution you to make sure you're benchmarking equivalent workloads.
And I know than benchmarking is hard, a coarse comparison is in scripts/compare.sh. More detailed performance tests are in test/TestPerformance.
Re: How FZF and ripgrep improved my workflow
#76I see these Vim-enhancment posts a lot. If you need to install a mountain of plugins just to make it usable, why not use a more modern editor? Seems like nostalgia for the Unix greybeard era, possibly some eletism for when someone who isn't intimately familiar with their config has to ask for help to use their machine.
Re: How FZF and ripgrep improved my workflow
#77I see these Vim-enhancment posts a lot. If you need to install a mountain of plugins just to make it usable, why not use a more modern editor? Seems like nostalgia for the Unix greybeard era, possibly some eletism for when someone who isn't intimately familiar with their config has to ask for help to use their machine.
Re: How FZF and ripgrep improved my workflow
#78Earlier quoted context omitted.
ido-mode was the standard back in the day. I have since moved to ivy/swiper but it was ido-mode that showed me the way some ten years ago (or more). One sad thing about FZF is that it doesn't also support tab-completion. Both ido and ivy support both tab-completion and fuzzy searching at the same time. They compliment each other really well and make these both much more general purpose tools. One import application i…
What made you switch? I'm still using Ido-mode and is quite happy.
Re: How FZF and ripgrep improved my workflow
#79Earlier quoted context omitted.
Honestly? I derive pleasure from hard work. I'm somewhat of a masochist in that way, I guess. I shun convenience and choose the hard path towards personal enlightenment.
Curious what the rest of your dev env is...
Re: How FZF and ripgrep improved my workflow
#80I see these Vim-enhancment posts a lot. If you need to install a mountain of plugins just to make it usable, why not use a more modern editor? Seems like nostalgia for the Unix greybeard era, possibly some eletism for when someone who isn't intimately familiar with their config has to ask for help to use their machine.
Exactly. I use a modern editor whenever I'm working on one of my main computers, and the only time I use vim is when I'm working on a remote server and can't mount the drive remotely (or where mounting would just be a pain). Because of that, I don't want any plugins when I use vim as I'll probably be using it on a new machine every time, and setting up my environment would be a waste of time.
There are situations where git is not installed or I can't download those files for security reasons set by administrators, but those situations have been pretty rare for me.