Worse HTML5 performance

Monkey Targets Forums/HTML5/Worse HTML5 performance

Soap(Posted 2014) [#1]
Anyone noticing dramatically worse HTML5 speed performance in recent builds like MonkeyXPro78g compared to older builds?

I set new game canvas to 100% browser window size/fullscreen and it runs way slow. A few Monkey builds ago it was running at full speed.

Edit:

Testing shows it runs terribly in Chrome now and SUPERBLY well in Firefox. Last time I tested it was the other way around...


nikoniko(Posted 2014) [#2]
Soap wrote:
Testing shows it runs terribly in Chrome now


Some people reported about troubles with latest version of Chrome browser. Usually fix was turning off hardware acceleration in the browser settings.


Soap(Posted 2014) [#3]
That was it!

chrome://flags/#disable-accelerated-2d-canvas

Disabled that and suddenly it's silky smooth again. I wonder if there is a way to disable it on the page for the user? Or just a fix for using accelerated 2d canvas. Other HTML5 projects run well.

With it enabled, it only happens in Chrome when the window is resized above a certain point. Other HTML5 games based on other dev tools do not seem to have this problem.


nikoniko(Posted 2014) [#4]
I am thinking we can not control it.

But...

Soap wrote:
With it enabled, it only happens in Chrome when the window is resized above a certain point. Other HTML5 games based on other dev tools do not seem to have this problem.


If engine uses requestAnimationFrame() instead of setTimeOut() it is correct for hardware acceleration.

Check this example for turn on/turn off acceleration. It uses requestAnimationFrame().
http://fhtr.org/gravityring/sprites.html

Also try to use webgl mojo's extension from Devolonter to speed up game in the Chrome based browsers.


nikoniko(Posted 2014) [#5]
Important notes for Windows + Chrome users! [+]
To get the best benchmark score for your machine, it is advisable to Disable VSync. Go to "about:flags" and toggle: Disable GPU VSync "Disables synchronisation with the display's vertical refresh rate when GPU rendering." This will resolve the issue with the Chrome implementation of "requestAnimationFrame()" that tries to maintain a steady 60 frames-per-second (FPS) but on Windows with accelerated 2D canvas support, it will drop immediately down to 30 FPS when 60 FPS is not achievable with no gradual degredation. On Mac/Linux the drop in FPS is gradual and therefore does not affect the benchmark. So if you see the FPS counter drop directly from around 60 FPS to 30 FPS then you should do this. This will not produce an "unfair" score as scores are based on time not the number of frames generated.


http://www.kevs3d.co.uk/dev/canvasmark/