Skip to content

Improve Dashboard Performance - #384

Open
dan-tang-ssd wants to merge 7 commits into
review-dashboard-page-3from
improve-dashboard-performance
Open

Improve Dashboard Performance#384
dan-tang-ssd wants to merge 7 commits into
review-dashboard-page-3from
improve-dashboard-performance

Conversation

@dan-tang-ssd

@dan-tang-ssd dan-tang-ssd commented Aug 20, 2026

Copy link
Copy Markdown
Member

This PR is submitted to fix #376

It is now ready for review.


It contains below changes:

  • add migration files to create 4 new tables dashoard_others_snapshot_xxx
  • add new command to pre-calculate dashboard OTHERS snapshot; run command at 2:00 AM as daily schedule job
  • update Laravel Controller and mysql stored procedure to get OTHERS result from snapshot (pre-calculated) instead of live calculation
  • update Vue component to show AS OF date (pre-calculated OTHERS)
  • add pest tests
  • fix performance issue when running application test

I tried 3 different institutions
Below is the previous testing result after adding indexes in tables in PR #383

Live env: 11.99 s    Local env: 3.76 s
Live env: 15.92 s    Local env: 5.25 s
Live env: 13.27 s    Local env: 4.24 s

I performed same testing for the same 3 institutions after using pre-calculated OTHERS result:

Live env: 12.04 s    Local env: 894 ms
Live env: 14.33 s    Local env: 1.78 s
Live env: 13.02 s    Local env: 1.86 s

@dan-tang-ssd

Copy link
Copy Markdown
Member Author

Note for deployment procedure:

  1. In order to have a pre-calculated OTHERS result for dashboard, we will need to manually run the new command after live env deployment.

…cessary COMMIT statement which confused Laravel to reseed the whole database before next test
@dan-tang-ssd

Copy link
Copy Markdown
Member Author

Fixed performance issue for running application test.
Duration: 1334.84s → 58.35s (~23x faster)

It is caused by an unnecessary COMMIT that confused Laravel to reseed the whole database before running next test.

@dan-tang-ssd dan-tang-ssd changed the title Improve dashboard performance Improve Dashboard Performance Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant