Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

internal/server: Cache Horizon URL Name and Host for Deploy Bundle #2950

Merged
merged 3 commits into from Jan 27, 2022

Conversation

briancain
Copy link
Member

Prior to this commit, when crafting a Deploy bundle, we would include
the applications deployment URL for each deployment in the bundle.
Looking up this hostname requires making an HTTP request to Horizon. The
way this was originally written, we would look up that URL for all
requested deployments. If a user had 80+ deployments in the bolt db,
this request would take quite some time.

Given that each applications deployment vanity name and hostname should
be the same, and only differs by the deployment sequence, we don't need
to get the hostname for each requested deployment. Instead we can grab
it once, and use it for the remaining deployments in the bundle.

Fixes #2304

In my testing, I had around 180 deployments and the request took about 5 seconds to process.
Now with this fix, the same number of deployments only takes ~30-50 ms. For reference, it only
takes about 20 ms to list a single deployment.

Prior to this commit, when crafting a Deploy bundle, we would include
the applications deployment URL for each deployment in the bundle.
Looking up this hostname requires making an HTTP request to Horizon. The
way this was originally written, we would look up that URL for all
requested deployments. If a user had 80+ deployments in the bolt db,
this request would take quite some time.

Given that each applications deployment vanity name and hostname should
be the same, and only differs by the deployment sequence, we don't need
to get the hostname for each requested deployment. Instead we can grab
it once, and use it for the remaining deployments in the bundle.

Fixes #2304
@briancain briancain added bug Something isn't working pr/no-changelog No automatic changelog entry required for this pull request backport/0.7.x labels Jan 26, 2022
@briancain briancain requested a review from a team January 26, 2022 19:54
@github-actions github-actions bot added the core label Jan 26, 2022
@briancain briancain removed the pr/no-changelog No automatic changelog entry required for this pull request label Jan 26, 2022
@briancain

This comment has been minimized.

Copy link
Contributor

@jgwhite jgwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve performance of UI_ListDeployments and UI_ListReleases
4 participants