After doing some more testing with the CocoonJs Launcher I think I've found what was causing most of my slow speeds. It had to do with using a random time. I like using random events but they were killing performance on mobile. I was using both a "wait random(30,60)" and a "every random(30,60)". I only had a few events set up to use random times. Removing the random expressions completely, or setting the events to only fire at certain times solves most of my slow speeds. I still have some more optimizations to do. But now I've been seeing the frames per second running up in the 60's with CocoonJS. A pretty big increase in performance to say the least.
If anyone has any interest in exporting to iOS I strongly recommend the CocoonJS Launcher. It is a fantastic tool for testing! The app itself is really well designed and makes it so easy to test right on the device. Don't think about it, just install it.
The CocoonJS launcher gives me an unrelated error message in the log file. It doesn't seem to effect performance or functionality in game that I've noticed. I didn't know if this message would be anything you'd want to know about or not. Here's the error message.
JSUtilities Exception: TypeError: 'undefined' is not a function (evaluating 'caf(this.raf_id)') Line: 1219 File: ? Tag: onsuspended
I did a small test after looking around in the exported c2runtime.js and found that by removing the following two lines the error no longer reports to the log. Just thought you'd like to have the info of where the error is located.
if (this.raf_id !== 0)
Develop games in your browser. Powerful, performant & highly capable.
Huh, interesting about the random hitting the performance. Thanks for the info.
Thanks for sharing such crucial information. I use "random time" in my minigame too,tonight I shall try it out!
Well, my random(0.5,1)second has no cost on my performance. I just deleted them and the performance has not changed.