Closed frank-dspeed closed 3 years ago
easy
See branch v4 for implementation: https://github.com/paulmillr/readdirp/tree/v4
Execute node examples/list
, ensure to pass big directory there.
opendir
works, you'll need node 12.12, it's 3x slower than readdir
— MEH! It's as slow as current readdirp-v3.Hi, @paulmillr Why is opendir
slower instead?
@yisibl ?
opendir works, you'll need node 12.12, it's 3x slower than readdir — MEH! It's as slow as current readdirp-v3.
What is the question? Open dir is 3x slower. Why is it slower? I don't know. Shitty node.js implementation.
NodeJS > 12.11.1 will have async readdir support Landed in cbd8d71 ( nodejs/node@cbd8d71 ) as fs{Promises}.opendir(), which returns an fs.Dir, which exposes an async iterator.
to stay compatible we could implament it with the same stream interface and simply check if fs.openDir is there if not fallback to existing implamentation.
This is a lobby Request <3 by the microsoft/vscode community