Repository navigation
Conversation
1f8fb48 to
f88fc45
Compare
There was a problem hiding this comment.
Nit: having a Start method on a handler is counter intuitive. I'd prefer it be inlined here and req not be a member. (It's referenced in ListObjectsV2Handler::operator() but it still doesn't need to be a member since the same ListObjectsV2Request is passed as an argument)
There was a problem hiding this comment.
ListObjectsV2Handler::operator() gets the request as a const-ref, though. On the contrary, WalkChild doesn't have any need for the request object except to pass it to the handler.
There was a problem hiding this comment.
Nit: this would be more readable if you rewrote as
Result<bool> DoHandle(... args);
void operator()(... args) {
std::unique_lock<std::mutex> guard(walker->mutex_);
auto maybe_truncated = DoHandle(args...);
if (maybe_truncated.ok() && *maybe_truncated) {
DCHECK(!result.GetNextContinuationToken().empty());
req.SetContinuationToken(result.GetNextContinuationToken());
walker->client_->ListObjectsV2Async(req, *this);
return;
}
walker->ListObjectsFinished(std::move(maybetruncated).status());
}There was a problem hiding this comment.
since this is common to any recursive walk, should it be inlined in ListObjectsV2Handler::DoHandle or so?
Use the AWS SDK async APIs to launch child directory reads concurrently as soon as we get the required information from a parent read. Also, similarly issue directory tree deletion commands in parallel. On this machine, listing the entire directory tree at "s3://mf-nwp-models/arome-france/v2/2020-12-02" goes down from 12 seconds to 2 seconds (a 6x speedup).
f88fc45 to
9bf4cba
Compare
Use the AWS SDK async APIs to launch child directory reads concurrently as soon
as we get the required information from a parent read.
Also, similarly issue directory tree deletion commands in parallel.
On this machine, listing the entire directory tree at "s3://mf-nwp-models/arome-france/v2/2020-12-02"
goes down from 12 seconds to 2 seconds (a 6x speedup, for 12944 directory entries).