Closed RReverser closed 4 years ago
Actually, it looks like the ability to select multiple directories was now removed: https://wicg.github.io/native-file-system/#dictdef-directorypickeroptions. The UI would never let you pick multiple directories (the legacy method does), but the option was there. I will simplify the code accordingly.
Before this, reading multiple files or directories has been done serially, even though Native File System provides a Promise-based API.
This PR leverages the API to full extent by scheduling all reads in parallel, and then waiting for all results.
On an example of a folder with 100 files, this makes the "open directory" demo go down from 90ms to 60ms (1.5x speedup) on my machine, and will be even better on larger lists.