c2runtime.js filesize - the cause of pre-launch pause?

Discussion and feedback on Construct 2

Post » Fri Jun 27, 2014 5:22 pm

**EDIT: See my post with images farther down this page for better data regarding this post**

We have a rather large project that begins with a 10 second black screen before launching on iPad (via CJS) and Android (via Crosswalk) devices.

Initially, I assumed it had to do with RAM since our images, when decompressed in RAM, take up just under 100 MB. As a test, I resized all images to 8x8, eliminating RAM as a possible culprit, and the black screen time didn't change.

We also had hundreds of small audio files that I thought could have been an issue. I removed them all, and it didn't help.

The only thing I can think of is that the size of c2runtime.js is the problem. It is currently at 8.52 MB (non-minified). It's going to be a lot more time consuming to trim down this file for testing purposes and still have the app work, obviously. Before I start, I wanted to ask if anyone else has experienced similar issues or if there is an explanation as to what a device is doing with the app prior to getting to the loader layout. There is no pause or anything when previewing in a browser on my PC.

I searched these forums and only found a loosely-related thread having to do with Windows 8 and large c2runtime.js filesizes. I'm looking for a deeper explanation if anyone has it! Thanks in advance :)
Last edited by clrammer on Sat Jun 28, 2014 6:28 pm, edited 1 time in total.
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Fri Jun 27, 2014 5:50 pm

Resizing to 8*8 may not help anything if the sprites tiled do not fit into a power of two well.
Also any thing third party could slow things down as well, leaderboards, scripts, notifications, etc.
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Sat Jun 28, 2014 12:00 am

Thanks for the reply, Newt. After much time spent cutting out gobs of content, I was able to reduce the size of c2runtime.js by 40% and it resulted in exactly a 40% reduction in black screen time for Android (via Crosswalk). It was actually even more of a reduction for iOS (via CJS) which is interesting.

Next question - does anyone know how we can show a splash image that displays throughout the whole black screen using Crosswalk? I tried specifying a splash screen in the build options, and it displays it properly when the app starts, but then it disappears during the black screen. I'm looking for a solution like Ludei has with CJS where their logo persists throughout the black screen.

Thanks!
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Sat Jun 28, 2014 12:11 pm

It's probably the javascript parse time. Why aren't you minifying the file? It should be able to bring it down to under half the file size making the startup time that much quicker too.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Sat Jun 28, 2014 6:15 pm

@Ashley I actually did minify during my export tests as well, but didn't explain that very well (at all) in my OP.

I refreshed all of my testing data this morning and pasted it below. Here are my observations:
1) Minification does not result in anywhere near a 1:1 reduction in black screen time.
2) Oddly, small projects (i.e. our Lite version) benefit more from minification than large projects (i.e. our Full version). This is particularly true for Crosswalk.
3) Minification from the Crosswalk export is much better than the CJS export, yet the black screen times on Android are much higher then iOS. This, despite my Android device being much more powerful than my iOS device.
4) Reducing the number of events in your project has almost a 1:1 impact on reducing the black screen time, particularly for CJS.

EDIT: I answered some of my questions already, but I still would like to know why the Crosswalk splash screen doesn't persist through the black screen time? When I launch our app it correctly shows the splash screen that I specified during the Crosswalk build process and then goes to a black screen. I don't include the splash screen time in the readings below. Thanks!

Image

Image
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355


Return to Construct 2 General

Who is online

Users browsing this forum: tarek2 and 24 guests