Long startup time

97 views
Skip to first unread message

Emilio Shodi

unread,
Apr 6, 2015, 8:02:44 PM4/6/15
to fla...@googlegroups.com
Hi.
Sponsor is complaining about lond startup time. After asset loading is complete (preloader progress bar is full) there's long timespan before game actually shows up.
What could cause this problem?

Link to games:

Mark Knol

unread,
Apr 7, 2015, 12:43:40 PM4/7/15
to fla...@googlegroups.com
Hi there! I see this behavior only in the second game, but I dont see a preloader on that one. Are you processing stuff after preload? Is this on all browsers, or specific ones? Try tracing between progress and the complete signals. Maybe there is some heavy instantiation going on?

Ps. Nice games!

Emilio Shodi

unread,
Apr 7, 2015, 1:44:42 PM4/7/15
to fla...@googlegroups.com
Actually there is a preloader (white bar on top of the page). Weird thing you can't see it! What browser/device are you on?

I traced all steps in Main.hx (i updated second game so you can check it yourself)
On my test smartphone with Snapdragon 400 it takes ~30 seconds(!) to get from "PROGRESS_CHANGED_TO 1" to "ON_SUCCESS_FUNCTION_BEGIN".
Assets are loaded, but for some reason success signal is not emitted for ~30sec.


(That numbers near event strings is time since INIT event)

Ps. Thanks :)

вторник, 7 апреля 2015 г., 19:43:40 UTC+3 пользователь Mark Knol написал:

Bill Deakin

unread,
Apr 8, 2015, 5:55:28 AM4/8/15
to fla...@googlegroups.com
Both games are loading fine for me on both desktop and mobile, no noticeable delay.

I don't see a loading bar on the second game either - but a white bar on a white background probably explains why!

Emilio Shodi

unread,
Apr 8, 2015, 7:49:36 AM4/8/15
to fla...@googlegroups.com
What device are you on?
It happens in chrome for android and safari(iphone 5) sometimes.

Try this link:
games.boomerango.net/game/easy-words/

g.bom...@worldmatch.eu

unread,
Apr 10, 2015, 5:22:18 AM4/10/15
to fla...@googlegroups.com
I notice the delay (4-5 seconds) in the word game after the loading bar has reached 100%. Curious behaviour, as the (nice) game seems one that doesn't need a lot of instantiations, but I may be wrong.

There must be some heavy hotspots between "PROGRESS_CHANGED_TO 1" and "ON_SUCCESS_FUNCTION_BEGIN", this looks obvious, I am not saying anything new ;)
You should monitor every single step, if you do something between these two events.

g.bom...@worldmatch.eu

unread,
Apr 10, 2015, 5:28:36 AM4/10/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
Oh, I forgot: I am using Chrome 41.
Update: FireFox 37 looks faster, the word game starts after 2~ seconds loading 100%.
Windows XP -----> :(

Emilio Shodi

unread,
Apr 20, 2015, 3:21:10 PM4/20/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
The fact of the matter is that there's nothing between this steps.
I guess it's something in the loader. PROGRESS_CHANGED_TO 1 means 100% of assets are loaded therefore loader should call success function (which traces ON_SUCCESS_FUNCTION_BEGIN). But for some reason loader does it with a delay.

пятница, 10 апреля 2015 г., 12:28:36 UTC+3 пользователь g.bom...@worldmatch.eu написал:

g.bom...@worldmatch.eu

unread,
Apr 21, 2015, 4:10:40 AM4/21/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
Il giorno lunedì 20 aprile 2015 21:21:10 UTC+2, Emilio Shodi ha scritto:
> The fact of the matter is that there's nothing between this steps.

What kind of assets are you loading? Big or multiple atlasses/spritesheets? It could sound stupid, but i.e. big PNGs need a lot of time to be read and decoded to a bitmap in memory, depending on CPU and RAM speed too.

Emilio Shodi

unread,
Apr 22, 2015, 12:29:37 PM4/22/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
I have just found found out that the reason of such a long startup time is WebAudioSound.ctx.decodeAudioData( ... ) when decoding my music file (the biggest mp3). For now, i fixed it by forcing Browser.document.createAudioElement() and now it works MUCH faster.

Then i started googlin and here's what i found:

So i guess, it's not flambe's fault. 
But there' still one thing to do: figure out how to speed decoding up and how to make it work in flambe.



вторник, 21 апреля 2015 г., 11:10:40 UTC+3 пользователь g.bom...@worldmatch.eu написал:

Emilio Shodi

unread,
Apr 22, 2015, 12:31:53 PM4/22/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
Yeah, also there's one problem with audioElement — big delay between sound.play() and actual playing that sound. So, kind of have to make it work.

среда, 22 апреля 2015 г., 19:29:37 UTC+3 пользователь Emilio Shodi написал:

g.bom...@worldmatch.eu

unread,
Apr 23, 2015, 3:38:49 AM4/23/15
to fla...@googlegroups.com, g.bom...@worldmatch.eu
Try this, play the sound, immediately stop it, and after a few seconds play it again: check if the second play is faster (use some visual hint synchronized with play to see if they fire at the exact same time without no delay).
Reply all
Reply to author
Forward
0 new messages