Closed
Description
- Version: 12.12.0
- Platform: macOS catalina
- Subsystem: FS
I maintain the popular readdirp
module. Decided to try fs.opendir
from node 12.12. The results are suboptimal: it's 3x slower to walk file trees when compared to fs.readdir
.
To reproduce:
- Check out the gist: https://gist.github.com/paulmillr/4e3a4da2ad8e98cf0fe7dc819242532a
- By switching logic from
if (opendir)
toif (!opendir)
I get 3x speedup, which means opendir is 3x slower than readdir.