News for hackers. Stuff that matters.
Re:Find Files (Ff) – File Search Utility in Rust by robert_foss on Wednesday February 27, 2019 @03:29AM (#19261840)
There's also fd[1], which is written in rust and is super fast.

[1] https://github.com/sharkdp/fd

Re:Find Files (Ff) – File Search Utility in Rust by iruoy on Wednesday February 27, 2019 @04:30AM (#19262083)
I just did a little test. fd seems to be about 3 times as fast.

  Command      | Mean [ms]     | Min…Max [ms]
  -------------|---------------|---------------
  `fd .conf /` | 525.6 ± 17.7  | 505.3…552.0
  `ff .conf /` | 1760.8 ± 10.2 | 1744.6…1775.3
Re:Find Files (Ff) – File Search Utility in Rust by Someone1234 on Wednesday February 27, 2019 @10:37AM (#19263847)
Looking at the code, I believe because fd uses a loop, and ff uses function recursion to walk the path tree. Function recursion is easier to write, but definitely has some overhead.
Re:Find Files (Ff) – File Search Utility in Rust by winstonewert on Wednesday February 27, 2019 @11:12AM (#19264103)
My experience is that if you have to maintain your own stack (which you'd need to in order to recursively walk directories) its faster to use the builtin stack than to implement your own.

Further, it seems that this would IO-bound not CPU-bound so whatever small overhead exists in recursion vs iteration will not be noticeable.

I think the difference is rather that `fd` uses threads and `ff` does not.

Re:Find Files (Ff) – File Search Utility in Rust by vishaltelangre on Wednesday February 27, 2019 @11:26AM (#19264216)
> `fd` uses threads and `ff` does not.

Author here. This is true. ff does not use threads right now. I have started learning Rust just a few days ago. I am not quite yet familiar with advanced topics such as achieving parallelism using threads in Rust and other similar stuff. My knowledge of Rust is limited at this moment and I struggled to get the language concepts to work such as ownership, lifetimes, etc. I am sure that I will be able to improvise the ff's performance by some extent by gaining some more knowledge of Rust.

Re:Find Files (Ff) – File Search Utility in Rust by vishaltelangre on Thursday February 28, 2019 @11:16AM (#19272399)
UPDATE: Now ff also uses threads to achieve parallelism.
Re:Find Files (Ff) – File Search Utility in Rust by vishaltelangre on Wednesday February 27, 2019 @11:12AM (#19264101)
Author here. Slow behavior while searching through a large number of files is a known issue at this moment. I will definitely try to reduce it by some extent by immediately streaming to STDOUT (or to a non-TTY device if TTY is not STDOUT). Right now, the results are accumulated, filtered and then printed in one go.
Re:Find Files (Ff) – File Search Utility in Rust by tambourine_man on Wednesday February 27, 2019 @10:16AM (#19263706)
Z (fast shell jump) and ripgrep + FZF are among my favorite niceties. Not essencial, but so much more joyful to use.
Re:Find Files (Ff) – File Search Utility in Rust by ausjke on Wednesday February 27, 2019 @10:46AM (#19263914)
yes I use fd which is fast and great, along with 'rg' for grepping, both by the same author using rust.

hope someone can produce a C version of them for fun

Re:Find Files (Ff) – File Search Utility in Rust by burntsushi on Wednesday February 27, 2019 @12:35PM (#19265046)
fd wasn't written by me. :-)

The C version of ripgrep is the thing that came before ripgrep, The Silver Searcher.