Back on web
Tags
- Fairy Tale Twist
- Performance
As the web game marches towards world-wide-release, currently on company beta and released in Turkey and the Philipines, help is needed on the P80 load times.
Method
Use Chrome Developer Tools to capture Network traffic for a newly created user. Note: Charles Proxy cannot be used as it cannot peek into VPN traffic. Evaluate file use, size and download time. Evaluate CDN. Evaluate alternative representations, compression algorithm. When considering alternative representations and compression results were compared to compressed and uncompressed data. Only recommendations that would yield a reduction in both compressed and uncompressed states are presented. Consideration was given to risk of implementing change, amount of engineering effort to implement and potential yield.
Further work
Evaluate time from asset loading, e.g. power up structures, animation data, to first use.
Recommendations
- P0- Cycle URLS for all types [Risk: LOW, Effort: LOW, Yield: 20067ms out of 65174ms saving]
- P1- AVOID DUPE LOADS [Risk: LOW, Effort: LOW, Yield: 164ms out of 65174ms saving]
- P1- MINIFY JSON [Risk: MEDIUM, Effort: LOW, Yield 15126 - 17647ms out of 65174ms saving]
Bottom line: 29% further saving with compression
- JSON file 1 213862 bytes, 8986 bytes 96% saving through compression 80579 bytes 57% saving without compression 6948 bytes 97% saving with compression (29% smaller than unminified compressed)
- JSON file 2 346469 bytes, 19037 bytes 95% saving through compression 127432 bytes 64% saving without compression 13893 bytes 96% saving with compression (28% smaller than unminified compressed)
Note: https://npmjs.org/package/json-minify, sudo npm install -g json-minify
- P2- SPLIT ANIMATIONS INTO FIRST TIME USER vs THE REST [Risk: MEDIUM, Effort: MEDIUM, Yield: 16000ms - 24221ms out of 65174ms saving]
- P2- ON-DEMAND LOADING ANIMATION DATA [Risk: HIGH, Effort: HIGH, Yield: 24221ms out of 65174ms saving]
- P2- ON-DEMAND SOUND VARIATION LOADING [Risk: MEDIUM, Effort: MEDIUM, Yield: 14405ms out of 65174ms saving] In addition to the main sounds there are an additional 45 sounds to provide variation, e.g. Click_01, Click_02, Click_03. Reducing the audio load to only one variation saves 14405ms, audio effects would be repeated. However, the remaining variations can be loaded in the background and then played when available.
- P2- DONT LOAD UNUSED ATLAS [Risk: LOW, Effort: LOW, Yield: 162ms out of 65174ms saving]
- P3- TRIM ATLASES [Risk: LOW, Effort: LOW, Yield: TBD] Use more aggressive compression rate in the JPEG encoder. Provide high resolution art delay loaded.
- P3- MINIFY XML [Risk: LOW, Effort: LOW, Yield: LOW] May not beat XML compression XML file 1 1401368 bytes 124378 bytes compressed XML optimization is not about compressing XML to any proprietary binary format. For that purpose, please don’t hesitate to check out xmill (at&t) and XMLppm (sourceforge). Their intent is to make a binary format from XML by shrinking XML patterns. And indeed it is very likely to be so because of either of these :
- P3- OPTIMIZING XML FORMATS [Risk: HIGH, Effort: HIGH, Yield: likely less than xml compression] Note: compressing XML with zip far exceeds any gains possible from tweaking file formats.