Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411574 Posts in 69386 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 06:32:49 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Curious Flash Lag In Firefox
Pages: [1]
Print
Author Topic: Curious Flash Lag In Firefox  (Read 3107 times)
bateleur
Level 10
*****



View Profile
« on: March 17, 2010, 01:40:55 PM »

I've recently started running my current Flash project in a web browser having developed it mostly using a combination of AIR and Adobe's standalone Flash Player. Part of the difference one normally expects when doing this is for the application to run more slowly. However, I am instead seeing a very odd effect I've never encountered before and was wondering if anyone else knew what it was.

Every so often, with no apparent pattern, the game freezes for about 1/4 of a second. This is not just a skipped frame, it's significantly longer. The phenomenon has the following properties:

* It is not periodic.
* Affects only the user thread. Music continues to play smoothly.
* Still happens with the same frequency if I turn the music bitrate down or even disable it entirely.
* Still happens with the same frequency if I run the game at 20fps instead of 30fps.
* Is unlikely to be a garbage collection cycle since it is much too long and I do very little allocation in a typical game loop.
* Happens reliably on Firefox 3.6 but never on IE8. Not tested Chrome or Opera yet.
* Does not happen on the standalone player or when using AIR.
* Happens even on extremely simple levels with very few objects. Does not happen more often on complex levels.
* So far I have only tested this on my dev machine, which is a pretty meaty dual core machine with plenty of RAM. This game is hardly heavyweight anyway.

I haven't completed my own investigations yet, but I wanted to ask about this because I already cannot come up with any really convincing possibilities for what it could be. Anyone got any ideas?

Logged

Zachary Lewis
Level 1
*


Professional by day, indie by night.


View Profile WWW
« Reply #1 on: March 17, 2010, 01:47:06 PM »

What framework are you using to develop your application?

Do all the browsers have the same version of Flash installed?

Are you ever communicating with an object outside your Flash project?
Logged

jotapeh
Level 10
*****


View Profile
« Reply #2 on: March 17, 2010, 01:51:15 PM »

I've had performance issues with Firefox since sometime in 3.5. I was hoping 3.6 would end the madness, but alas, it does not. In fact 3.6 seems to break some things that worked just fine in 3.5, I suspect they are imposing new security restrictions or sandboxing it differently, I'm not sure.

My 'solution' was to use Safari. Not much of one.
Logged
bateleur
Level 10
*****



View Profile
« Reply #3 on: March 17, 2010, 02:01:18 PM »

My 'solution' was to use Safari. Not much of one.

An acceptable solution for a user, but not so much for a developer. Panda

What framework are you using to develop your application?

CS4 (set to Actionscript 3 / Flash Player 10).

Quote
Do all the browsers have the same version of Flash installed?

10.0.45.2 in both cases.

Quote
Are you ever communicating with an object outside your Flash project?

No. No network use of any kind.

FWIW my current guess is that Flash is somehow managing to cache a Sprite as a Bitmap in such a way that it inappropriately reallocates the BitmapData every frame, eventually triggering a monster GC. It shouldn't be, but I can't currently think of anything else that would be quite so time consuming.
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #4 on: March 17, 2010, 03:16:07 PM »

How are you embedding it? I once got rid of a problem like this using SWFObject rather than a plain object tag. In general, Firefox just doesn't seem to get on that well with flash. *sigh*

Could it be related to when Firefox does it's GC, considering how monolithic it is? Some developer extension can probably let you know.
Logged
jotapeh
Level 10
*****


View Profile
« Reply #5 on: March 17, 2010, 06:25:35 PM »

My 'solution' was to use Safari. Not much of one.

An acceptable solution for a user, but not so much for a developer. Panda

Eh. Not even, really. Most users will tell you where to stick it if you require that they use a certain browser.

That said, my day job involves pandering to the web needs of IE6 corporate customers ... pretty much any browser looks golden after a day in the office  Apoplectic
Logged
BlueSweatshirt
Level 10
*****

the void


View Profile WWW
« Reply #6 on: March 17, 2010, 08:57:44 PM »

I constantly had this problem in Firefox, the 1/4-or-so second freeze. Except for me, this problem wasn't just with Flash, it was for the entire browser. It was just considerably less noticeable when just viewing web pages. It began to become apparent when I was getting the same issues with Unity games.

My solution: Move to Chrome.
Logged

Triplefox
Level 9
****



View Profile WWW
« Reply #7 on: March 17, 2010, 09:18:21 PM »

Try upping the amount of local storage allocated for Flash. When it gets crowded Flash/FF tends to start getting intermittent pausing.
Logged

Zachary Lewis
Level 1
*


Professional by day, indie by night.


View Profile WWW
« Reply #8 on: March 17, 2010, 09:22:00 PM »

I constantly had this problem in Firefox, the 1/4-or-so second freeze. Except for me, this problem wasn't just with Flash, it was for the entire browser. It was just considerably less noticeable when just viewing web pages. It began to become apparent when I was getting the same issues with Unity games.

My solution: Move to Chrome.

I had that same problem, but with Chrome. It would freeze whenever I was running my laptop on battery power. Opera seemed to work well, but I like Chrome the best.

@bateleur: By framework, I meant flixel or FlashPunk or whatever. It's good to know you're targeting Flash 10, though. The more I hear about it, it doesn't seem like a Flash problem (or if so, it's one you're not going to be able to fix). Sad
Logged

bateleur
Level 10
*****



View Profile
« Reply #9 on: March 17, 2010, 11:36:55 PM »

How are you embedding it?

Using object tags. (Well OK, actually using Adobe's 200+ line autogenerated magic code, but I'm pretty sure that amounts to an object element in this particular case.)

Try upping the amount of local storage allocated for Flash.

Well yes, this might work. But again, this is a user end solution. It doesn't help me, because I need to distribute this game.

@bateleur: By framework, I meant flixel or FlashPunk or whatever.

Ah, right. No, not using a framework.
Logged

Triplefox
Level 9
****



View Profile WWW
« Reply #10 on: March 18, 2010, 08:02:47 PM »

Well yes, this might work. But again, this is a user end solution. It doesn't help me, because I need to distribute this game.

It's a known problem afflicting many shipped Flash titles. I don't think you can reject it out of hand, unless you think you're smarter than the other devs that have run aground of it.
Logged

bateleur
Level 10
*****



View Profile
« Reply #11 on: March 18, 2010, 11:41:52 PM »

I don't think you can reject it out of hand, unless you think you're smarter than the other devs that have run aground of it.

Indeed not, but I need to at least try to fix it.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic