News for hackers. Stuff that matters.
Re:Find Files (Ff) – File Search Utility in Rust by madmax96 on Wednesday February 27, 2019 @11:42AM (#19264361)
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?
Re:Find Files (Ff) – File Search Utility in Rust by setr on Wednesday February 27, 2019 @01:23PM (#19265576)
tbh 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
Re:Find Files (Ff) – File Search Utility in Rust by vishaltelangre on Thursday February 28, 2019 @05:22AM (#19270350)
In 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
Re:Find Files (Ff) – File Search Utility in Rust by vishaltelangre on Wednesday February 27, 2019 @11:54PM (#19269028)
In 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