Speed & appearance improvements to the results page (#4043)
Fixes #3941.
This makes some speed improvements to the results page
along with fixes to the appearance of some currency values. Some of the
biggest improvements come with the initial loading of the
`/submissions/result/` with no filters/query params applied, the
`.values()` for all submissions were being calculated twice. After some
crude benchmarking with very large (OTF scale) datasets, it seems to be
~26% faster. Other improvements were just not loading fields that were
irrelevant to the data presented.
Testing of initial loading of `/submissions/result/` was as follows:
**Unoptimized**
| Trial | SQL Time (ms) | SQL Queries |
| ----- | ------------- | ----------- |
| 1 | 3715.86 | 32 |
| 2 | 4429.34 | 33 |
| 3 | 4449.12 | 33 |
| 4 | 4615.63 | 33 |
| 5 | 4852.89 | 33 |
*Average SQL Time:* 4412.57
**Optimizied**
| Trial | SQL Time (ms) | SQL Queries |
| ----- | ------------- | ----------- |
| 1 | 3006.05 | 32 |
| 2 | 3448.47 | 32 |
| 3 | 3315.12 | 32 |
| 4 | 3317.39 | 32 |
| 5 | 3137.71 | 32 |
*Average SQL Time:* 3244.95
Hopefully this leads to less crashing on production. If you see anything
else that can be optimized let me know!
## Test Steps
<!--
If step does not require manual testing, skip/remove this section.
Give a brief overview of the steps required for a user/dev to test this
contribution. Important things to include:
- Required user roles for where necessary (ie. "As a Staff Admin...")
- Clear & validatable expected results (ie. "Confirm the submit button
is now not clickable")
- Language that can be understood by non-technical testers if being
tested by users
-->
- Ensure the `/submissions/result/` view...
- [ ] is snappier and doesn't crash on load
- [ ] has proper decimal amounts & currency symbols
---------
Co-authored-by:
Fredrik Jonsson <frjo@xdeb.org>
Showing
- hypha/apply/funds/templates/funds/includes/submission_stats.html 0 additions, 24 deletions...pply/funds/templates/funds/includes/submission_stats.html
- hypha/apply/funds/templates/funds/submissions_result.html 8 additions, 6 deletionshypha/apply/funds/templates/funds/submissions_result.html
- hypha/apply/funds/utils.py 35 additions, 0 deletionshypha/apply/funds/utils.py
- hypha/apply/funds/views.py 30 additions, 9 deletionshypha/apply/funds/views.py
- hypha/apply/utils/templatetags/apply_tags.py 36 additions, 12 deletionshypha/apply/utils/templatetags/apply_tags.py
Loading
Please register or sign in to comment