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.
Closes #1891
The existing asset list endpoint is inefficient with how it queries the database, resulting in unnecessarily long response times from that endpoint. This is improved in the following ways:
raise_if_unauthorized
methodThe results of these improvements are shown below. Note that these are the times for the SQL queries themselves, not the overall page load, as that can be inflated by the amount of data returned, and isn't useful for this discussion.
A couple things to note going forward:
count
query (the query that returns the total number of hits from which you're returning a single page) is usually slower than the query of interest itself, which makes sense. We may want to rethink the structure of our API respones if further optimization is desired, as if we were to remove this count, we would see a pretty widespread 2x speedup.