Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Changed & Why
I noticed that the activation step of our deployments was getting pretty slow. When digging into it I figured out that it's because we have 60,000+ revisions for each app deployed and the activation process uses S3's
ListObjects
no fewer than 3 times to get that list of revisions. This gets to be pretty slooooow!This PR includes the first simple changes which don't change existing functionality. In a couple of places the list of all revisions were being loaded just to figure out if the passed revision was valid. Instead we can pass a
prefix
toListObjects
which is the entire key we are searching for. Rather than downloading them all and searching them clientside we just try to download the one we want.For one of our apps with a fair amount of history (just over 60,000 deployments) this takes the activation down from 835s to 590s (a 30% reduction on my computer and internet connection - probably a bit better from CI!).
There are still two places in the flow where we download the entire list of deployed items but the fix there is less simple...
Related issues
I discuss potential follow up tasks in #120
PR Checklist
People
All maintainers ;)