Frame rate become 20fps even though setting up to 60 fps

Frame rate become 20fps even though setting up to 60 fps
0.0 0


setting up the frame rate to 60 and when i run my game on fire fox, frame rates becomes 20.
weird thing is that it becomes 60 fps if i made window size minimized or maximized.
so it did happens when i run the game at first place even during game playing unless i make its window size minimized or maximized. only in firefox not chrome and explorer.
what’s the problem?

first_starting_game.PNG (131.5 KB)


when i make window minimized or maximized


maybe the game is too slow and can’t run at 60fps, nothing wrong


if the game too slow to run at 60fps and hasn’t any problem, why the game run at 60fps in other browser?
additionally, we don’t know why firefox browser fixes frame rate to 20.


Hi, Charlie,

I noticed that your game runs at 60 fps in smaller window, and when it’s maximized, the fps drops down to 20.
There are a few things:

  1. Larger the canvas is, more it consumes to draw things, then the frame rate drops, it’s not relevant to your settings, the fps in settings just fix the maximum frame rate.
  2. There are difference between navigators, as we used requestAnimationFrame function, some navigator will reduce the frame rate when the CPU/Memory consummation is big.
  3. I noticed in your picture, the main loop of your game takes only 0.001 second per frame(the second line in stats). That means the main loop doesn’t consume much, so it’s mainly related to your canvas size, not your game logic.



there is nothing wrong with game logic. i thought something wrong happens in canvas size too. but weird thing is it happens only the first time running the game. after that if i not only minimize but also maximize the screen, it becomes 60 fps even though window screen becomes larger size than first time i run. same thing happens in ‘HelloHTML5World’ file in cocos2d example. only in firefox. plz check this file.

(actually when i start browser in small screen at first, its fps becomes 35. when i start browser in full screen at first, its fps becomes 20. after that i change the screen size whether bigger size or smaller size, it is working correctly as 60 fps. what is wrong?)


Sorry, but with your sample, I can’t reproduce the effect you are seeing. Can you tell me what version of cocos2d-html5 are you using?
The current version is 2.2.2


mine is Cocos2d-html5-v2.2.2. the current version.
‘HelloHTML5World’ file exists in current version of Cocos2d-html5-v2.2.2 file.
same thing happens in my friend’s computer too.


What’s the version of your Firefox? and on which plateform? I will try to do a complete test


I find Firefox version which is 26.0. Frame rate become 60 when I change renderMode default to canvas only. How we can improve frame rate in other way?


I tested on Firefox Windows with webgl render mode, still can’t see the difference between first run and later.


I use cocos2d-js v3.x and found that on FireFox too, if renderMode = 0, the fps drop down to 20.