breautek commented on issue #605: URL: https://github.com/apache/cordova-plugin-file/issues/605#issuecomment-1722346738
154k files in a single directory? ouff... I'm not sure if you're working with android or iOS but on android I'm curious how much time is spent at [listFiles](https://github.com/apache/cordova-plugin-file/blob/360a73c2c257258e4108f5c290917bed5193e34b/src/android/LocalFilesystem.java#L228) or if the bottleneck is mostly in the cordova bridge. I believe the iOS equivilant is [here](https://github.com/apache/cordova-plugin-file/blob/360a73c2c257258e4108f5c290917bed5193e34b/src/ios/CDVLocalFilesystem.m#L397) If the bottleneck is at the native API level on iOS, I'm not sure if there is anything that can be done, as far as I can tell iOS doesn't offer any stream API other than `NSDirectoryEnumerator` which will do a deep recursive traversal (which isn't what we want) For Android, there is a [DirectoryStream](https://developer.android.com/reference/java/nio/file/Files#newDirectoryStream(java.nio.file.Path)) API but it's an API 26+ API so it's not something that can be used yet... as cordova needs to support API 24. If the bottleneck is at the bridge, then introducing a stream read API might be possible so you don't need to transfer the entire dataset of 154k file entries in one API response, but I personally don't have time to allocate introducing such feature. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
