Jump to content

Poor performance in Firefox on OSX?


ChubbRck
 Share

Recommended Posts

Here's a dilly of a pickle I'm having...

 

I'm using CANVAS as my renderer. The game I'm building works great on Chrome but on Firefox, specifically for OSX, I'm having issues.

 

For instance, a 4GB RAM Intel Core i3 PC running Firefox runs great but a 8GB RAM Intel Core i5 Macbook Pro running Firefox runs laggy... I've tried switching to bitmap fonts and reduce other expensive operations but still...

 

Is there any one who has experienced this or who knows what's going on? (Please spare me the 'PCs are better' jokes :)

 

Nick

Link to comment
Share on other sites

Hi Oliver, thanks for your response. Unfortunately, I don't have access to the laptops right now to install wine and to check but I imagine performance would be good as the game runs great in a PC with Firefox and half the RAM / lesser specs.

 

As for pasting my code, I am happy to do so, but I am not sure what relevant parts to post as the whole code is quite long (~1200 lines). In my update loop I'm generally:

 

  • Checking for window resize and resizing scale accordingly
  • Manually animating background clouds across the screen per frame
  • Calculating the chance of firing an 'enemy' and creating one if necessary
  • Updating the game timer and score display (using bitmap text)
  • Checking for user input
  • Updating player position

Is there a part of the update loop that you would like me to show specifically?

 

Nick

Link to comment
Share on other sites

Hi Oliver, thanks for your response. Unfortunately, I don't have access to the laptops right now to install wine and to check but I imagine performance would be good as the game runs great in a PC with Firefox and half the RAM / lesser specs.

 

As for pasting my code, I am happy to do so, but I am not sure what relevant parts to post as the whole code is quite long (~1200 lines). In my update loop I'm generally:

 

  • Checking for window resize and resizing scale accordingly
  • Manually animating background clouds across the screen per frame
  • Calculating the chance of firing an 'enemy' and creating one if necessary
  • Updating the game timer and score display (using bitmap text)
  • Checking for user input
  • Updating player position

Is there a part of the update loop that you would like me to show specifically?

 

Nick

If I am honest. I most likely won't be one of the people who can help you out but there may be some people on this forum who can help. I advise you upload your project to Dropbox or somewhere that lets you quickly host stuff.

 

I am guilty of not posting my code now and again on coding forums. Don't worry about how much code you have. In this case it seems important that people can see your code. BUT it might be your computer that has a problem and the code might work well. It sounds like that might be the case because it does not apply to PC Firefox or Chrome. It would be nice if you could get somebody else to test it on there Mac.

 

Hope this might help

Link to comment
Share on other sites

I know this won't be of much help, but Firefox on the Mac has never been canvas friendly (2d context at least). All my stress tests have shown it to be by far the slowest. When Chrome can render 8000 sprites on a screen, expect Firefox to handle 1000 (at 30fps).

 

However since you're using Phaser, and Phaser uses Pixi.js you should be getting the 3d context (webgl)... see if construct2 has the same issue on your machine: http://www.scirra.com/demos/c2/sbperftest/

When I run that demo, I get ~60fps in Firefox (2007 iMac).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...