Open edwardchalstrey1 opened 2 months ago
Time before changes implemented (commit 3f173e7).
shapesData | Mb | Python time (local) | Template time (local) | Python time (Turing VM) | Template time (Turing VM) | Template time (CSH VM) |
---|---|---|---|---|---|---|
Load of all shapes | 111.69 | 0.52 | 6.10 | 3.72 | 20.42 | 34.43, 122.74, 32.52 |
Load of all shapes with vars | 187.89 | 5.87 | 15.29 | 8.70 | 31.72 | 70.05, 182.29, 120.71 |
As of commit 60f2ba
:
shapesData | Mb | Python time (local) | Template time (local) | Python time (Turing VM) | Template time (Turing VM) | Template time (CSH VM) |
---|---|---|---|---|---|---|
Load of all shapes | 111.68 | 0.54 | 6.01 | 3.67 | 20.12 | 65.85 |
Load of all shapes with vars | 80.12 | 5.03 | 9.06 | 6.63 | 12.94 | 39.60 |
Where VMs are connected to on internet speed of: 13Mbps download (note: in reality this varies a lot)
This suggests the following:
TODO:
assign_variables_to_shapes
and the categorical func too work with the "shapes" sans geometries? Then once this gets passed through to the template, merge the shapes dict that includes variables with the shapes dict that includes geometriesGZipMiddleware
but this seemed to make it slower not fasterEven after merging #97 this can still take almost 3 minutes
Could we speed up loading further with adding compression to Nginx?
Role
Developer
Desired Feature
Opening the world map, the variables dropdown is available faster
Benefit
Avoid long wait time for variables to be fully loaded
Acceptance Criteria
All data variables used to colour the World map should be loaded in under one minute
Dependencies
No response
Technical Notes
TODO
Need to figure out if the time the variables functions take to run, or the size of the data in Mb is causing the problem. Almost certainly it will be the latter, otherwise it would also be slower on faster internet connections or when running locally.
Could one way to refactor this be that there is a new view function that gets called each time the variables dropdown is changed, and this gets a data dict linking each shape id to the variable info, which updatesThis would be an enormous refactor, see the alternative below that has resulted in a significant speed upshapesData
in the world map template?