4 ms·
First, I have a problem with rewriting common utilities (like find, which also supports more search functionality than regex) while changing flags (e.g. `i` to
by madmax96 8y ago
First, I have a problem with rewriting common utilities (like find, which also supports more search functionality than regex) while changing flags (e.g. `i` to ignore case to `s` - incidentally, grep also accepts `i` to ignore case). It makes it harder to explore the system interactively, particularly for beginners.
Second, the utility already exists, and this version is significantly slower:
> time ./ff '.*.cpp' ~/src/ > /dev/null
real 0m1.195s
user 0m0.488s
sys 0m0.671s
> time find -E ~/src/ -type f -regex '.*.cpp' > /dev/null
real 0m0.880s
user 0m0.407s
sys 0m0.425s
But wait! This is a totally unnatural use of find. If we use find like users actually do, we get even better performance:
time find ~/src/ -name '*.cpp' > /dev/null
real 0m0.553s
user 0m0.181s
sys 0m0.363s
Hardly scientific. But it begs the question: who is this for?
- setr 8y agotbh find's command line interface is extremely unnatural, and that alone would justify a switch for me. Ofc, there's no reason that the program itself needs to be reimplemented beyond its argument parser, but that's not that concerning for me as long as its still fast enough
- deleted 8y ago[deleted]
- vishaltelangre 8y agoIn ff v0.1.3, the slowness is reduced to some extent. > ff '.*.js' ~/projects > /dev/null 5.79s user 14.77s system 97% cpu 21.024 total > find -E ~/projects -type f -regex '.*.js' > /dev/null 3.98s user 10.76s system 67% cpu 21.933 total
- vishaltelangre 8y agoIn ff v0.1.4, the results are dramatically improved. > ff '.*.js' ~/projects > /dev/null 7.59s user 24.21s system 337% cpu 9.413 total