G'day fellow C2 devs.
Due to the lack of documentation on CJS, I was curious about how CJS handles asset loading & memory on startup so I compared the results of two games of mine, Star Nomad & remade Ninja Legacy RPG Defense.
In particular I noticed something odd, Star Nomad takes ~22 seconds to load all assets on most devices and consumed ~155MB of RAM. Ninja Legacy takes ~12 seconds to load and consumes ~125MB of RAM. There is quite a significant load time, which isn't explained by Store services or what not since they both have it. It then dawn on me, all this time I was worried about optimizing image assets to keep the RAM usage low, that this load time can be explained by CJS loading & decompressing audio, all of it, on launch.
It also explains why CJS doesn't need to use preload audio to prevent first sound played lag, like XDK/Crosswalk.
For comparison sake:
Star Nomad only have ~46MB worth of sprite-sheet assets in RAM, following the power of 2 * 4 convention, ie. 64 x 64 x 4 = ~16kB RAM texture, 512 x 512 x 4 = 1MB etc. Ninja Legacy has ~80MB of sprite sheets.
The difference comes down to Star Nomad having a lot more audio tracks, ~10 minutes extra worth of audio music. This causes it to use ~ 60MB more memory minus the sprite differences.
Pretty rough analysis, but it seems 1 minute of audio music = ~6MB in ram, which is pretty huge, not just in terms of memory use, but the fact it has to decompress the audio make your game loads much longer. So for those who weren't aware and working on mobile games, I hope this is helpful.