Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize database performance of the footer API #5530

Merged
merged 2 commits into from Apr 3, 2019

Conversation

@davidfischer
Copy link
Contributor

@davidfischer davidfischer commented Mar 22, 2019

Currently, the number of database queries in the footer API depends on the number of versions of the project in question. This optimizes the API to always be a constant number of queries.

This PR partially fixes #3712 in that it fixes the major performance issues with the resolver when generating a number of URLs for different versions of the same project. Currently project.ordered_active_versions is only used by the footer API but anywhere else looking to generate URLs for a list of versions could use that function to get the same performance benefits.

The test case does seem a little bit brittle but I'm not sure what the best way to improve that is.

@davidfischer davidfischer requested a review from Mar 22, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Solid improvement! Will be curios to see how this improves performance on the footer API. I wonder if it's worth another PR to add these improvements to the version listing page, at the least?

@davidfischer
Copy link
Contributor Author

@davidfischer davidfischer commented Mar 25, 2019

Will be curios to see how this improves performance on the footer API

This should be a large improvement but it's hard to say exactly how large it will be because footer API calls with 1-2 versions won't be improved as much.

I wonder if it's worth another PR to add these improvements to the version listing page, at the least?

That's a good idea.

@ericholscher ericholscher merged commit ac3185a into master Apr 3, 2019
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the davidfischer/optimize-footer-api branch Apr 3, 2019
@ericholscher
Copy link
Member

@ericholscher ericholscher commented Apr 3, 2019

Gonna ship this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants