Skip to content
Snippets Groups Projects
Unverified Commit 2eeb7501 authored by Wes Appler's avatar Wes Appler Committed by GitHub
Browse files

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: default avatarFredrik Jonsson <frjo@xdeb.org>
parent 531fff93
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment