Studio Hog: Speed Improvements

Introduction

As i’ve continued adding studios to the all countries page, the page load time has been increasing significantly. I just took a first crack at improving the speed and I was able to reduce it through optimization and backend clean. I wouldn’t say its resolved but I bought myself more time. Using googles developer tools I ran 5 individual tests for each studio type before and after the optimization to generate the results below.

Before/After Page Load Time

# StudiosPre-Optimization Load TimePre Mean Post-Optimization Load Time Post MeanSeconds ChangedLoad Time Reduction
VFX Studios406~5.12 – 7.306.21 ~2.52 – 4.69 3.60-2.6142%
Animation Studios177~3.53 – 5.064.29~1.85 – 3.282.56-1.7340%
Game Studios95~3.07 – 4.423.74~1.62 – 2.772.19-1.5541%

Below are my individual tests of which I used to generate the averages and percentages above.

Individual Page Tests

Time In SecondsVFX Studios(406)Animation Studios(177)Game Studios(95)
Pre-Opt Load Time #15.01 – 7313.38 – 4.942.92 – 4.46
Pre-Opt Load Time #25.21 – 7.423.53 – 5.033.05 – 4.34
Pre-Opt Load Time #35.13 – 7.283.65 – 5.193.06 – 4.34
Pre-Opt Load Time #45.22 – 7.343.53 – 5.083.18 – 4.47
Pre-Opt Load Time #55.03 – 7.153.58 – 5.083.16 – 4.50
Post-Opt Load Time #12.78 – 4.731.98 – 3.331.59 – 2.77
Post-Opt Load Time #22.62 – 4.561.89 – 3.441.68 – 2.80
Post-Opt Load Time #32.60 – 4.741.79 – 3.181.57 – 2.69
Post-Opt Load Time #42.35 – 4.381.81 – 3.241.54 – 2.69
Post-Opt Load Time #52.35 – 4.431.78 – 3.241.73 – 2.91

Why does it take so long to load?

Most of the load time is in the calculation of the locations estimated size. Of which is dependent on the looping through each studio adding its size to a variable and incrementing for each. This is done at each page draw, ideally this would be calculated at the insert, remove or change of studio size on a per location basis. However that will require a larger rework that after this major reduction of speed I’ve put lower on the priority list. I will continue monitoring the speed but hopefully these improvements will be enough for the time being.