Why benchmarks don't include readdirp?
The library seems to be a comprehensive attempt at building a recursive reader.
You've went to great lengths, however, it's strange that it's not checked against readdirp, which has 35M weekly downloads.
Feel free to add it to the benchmarks via a PR!
Recently discovered this, felt like testing this, so I wrote this: https://github.com/KoenDG/nodejs_readfs_testing
Not proper benchmarking, just a quick hacky solution to compare the two.
The code is a hackjob, commented out lines, tabs and spaces mixed up, but there's logic there.
How I set it up:
- Runs on my machine, 8/16 and 32GB RAM, which is plenty and not at all 100%ed during these tests.
- NFS mount, on my machine, coming from another machine in the house, wired 1GB/s connection. Server is HDD, not SSD of any kind.
-
- 130K files in total in the mounted dir.
fdir without stats: max 700ms, average 600ms
readdirp without stats: max 1200ms, average 1150ms
fdir with stats: Anywhere from 1.8s to 9.8s
readdirp with stats: Anywhere from 1.8s to 9.8s
Yes, that's the same for the two libraries.
The moment I'm getting the stats for the files, it's all over the place. No consistency at all in either scenario.
Without stat, just making the list, fdir is consistently 2x as fast.
That all being said... this is probably not proper benchmarking. But I felt like testing out the various ways of writing how both libraries work.