When building the model for a directory, there are repeated synchronous uses of the fs.lstat method. I have found that this can cause some serious latency when working with larger folders in s3, and would like to offer a couple of improvements:
get the metadata for each file once, and use both for removing deleted markers and getting last modified time.
use the underlying s3fs._info method instead of lstat. The _info method is async, and all the calls can be made concurrently with the existing s3fs event loop.
When building the model for a directory, there are repeated synchronous uses of the fs.lstat method. I have found that this can cause some serious latency when working with larger folders in s3, and would like to offer a couple of improvements: