-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CPDNPQ-2395] improve participants API load times #2101
Conversation
Review app deployed to https://npq-registration-review-2101-web.test.teacherservices.cloud/ |
Quality Gate passedIssues Measures |
@@ -10,7 +10,7 @@ module Pagination | |||
private | |||
|
|||
def paginate(scope) | |||
_pagy, paginated_records = pagy(scope, limit: per_page, page:) | |||
_pagy, paginated_records = pagy_countless(scope, limit: per_page, page:) |
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.
TIL about Pagy::Countless
💡
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.
Looks good 🔥
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.
LGTM - page_countless
should have a massive impact across the board
Context
Ticket: https://dfedigital.atlassian.net/browse/CPDNPQ-2395
requests to
/api/v3/participants/npq?page_size=3000&updated_since=2020-01-01
are too slow (~800ms)Changes proposed in this pull request
Tested using a production data dump, using lead provider Ambition Institute, which has ~46,000 users.
before optimisation: page load ~800ms
after optimisation: page load ~150ms