-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Refactor schedule
action in distributions_controller
for better preformance
#4509
Refactor schedule
action in distributions_controller
for better preformance
#4509
Conversation
…erformance - Separated the handling of JSON and HTML requests. The instance variable is not used in the HTML view, eliminating unnecessary data loading. - Implemented JSON-specific requests to leverage the `start` and `end` parameters from the FullCalendar library. This restrict tags the fetched distributions to the specified dates instead of all historical records. - Resolved the N+1 query issue by eager loading the associated partners with the distributions. - Add an index on issued_at to speed up the filtering on distributions
71f5e44
to
7905eb5
Compare
schedule
action in distributions_controller
for better preformanceschedule
action in distributions_controller
for better preformance
Ready for some review on this one, if there are any follow up questions or additional benchmarks that I need to take let me know! |
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.
Much faster. No noticeable pause at all when checked with the concerned bank's data on local.
Nice! I can work on resolving that conflict this evening, for this project do we prefer a merge or rebase strategy for getting new changes into this branch? @dorner |
If any review has been done, please merge and don't rebase. If it's prior to a review, rebase is better. |
All green - thanks! |
@grantmca: Your PR |
Resolves #4502
Description
start
andend
parameters from the FullCalendar library. This restrict tags the fetched distributions to the specified dates instead of all historical records.Type of change
Performance change meant to preserved the original behavior of the controller action
How Has This Been Tested?
I have tested this locally creating some mock data and testing out the loading speed of the calendar
I ran both page loads multiple times with the browser cache turned off and took the fastest time for both to ensure we are comparing as apples to apples as possible and both version can take advantage of query plan caching in PostgreSQL.
Screenshots
Before:
After: