-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Our current `lookup` does two concurrent ListObjects requests. After thinking about it a bit more carefully, one of them can be replaced with a cheaper, faster HeadObject request. The "unsuffixed" request we were doing was purely to discover whether an object of the exact looked-up name existed, which is what HeadObject does. Switching to HeadObject reduces the request costs of a lookup. One disadvantage of HeadObject is when looking up directories. The unsuffixed ListObjects we're replacing here could discover a common prefix and return it immediately without waiting for the other request to complete. But in practice, the two requests were dispatched concurrently, so the customer still pays for both requests, and the latency is the minimum latency of two concurrently ListObjects. Now, the latency for a directory lookup will be the maximum of a concurrent ListObjects and HeadObject. An issue in this change is that we expect HeadObject to return 404 when doing directory lookups, but right now the way our error types are structured gives us no way to distinguish 404s from other errors. For now, I'm just swallowing all errors on the HeadObject request, and I'll follow up with a broader change to fix our error handling story to make this work. This is a partial fix for #12, but in future we can do better for lookups against objects we've seen before by remembering their type. Signed-off-by: James Bornholt <[email protected]>
- Loading branch information
1 parent
f2c764f
commit 2c2c23c
Showing
1 changed file
with
32 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2c2c23c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.sequential_read_delayed_start
732.748046875
MiB/s1630.7705078125
MiB/s2.23
This comment was automatically generated by workflow using github-action-benchmark.