Performance issue on Safari

Monkey Targets Forums/HTML5/Performance issue on Safari

pit(Posted 2014) [#1]
Hi all,

I'm finishing to convert my game from Bmax to Monkey.
No problem with the desktop target, all is fine.
But with the HTML5 target, I experienced performance issues.
On the same MacBook Air:
With Firefox -> game running at 60 fps.
With Safari -> game running at 20 fps.

Did someone already experience such bad performance with Safari ?
And is there some specific "tips" to follow in order to have better perf on Safari ?

Thanks

Pit


Salmakis(Posted 2015) [#2]
maybe give those html5 webgl target from Mungo a shot:
http://www.monkey-x.com/Community/posts.php?topic=8435&page=1

you can just use the webgl target with the native monkey,
but in trade it may happen that then the game wont run properly on Internet Explorer 11 and below
so maybe put a Java script infront, wich determines the browser and then directs to the "standart monkey html5" or "wegl" Version.


pit(Posted 2015) [#3]
Thanks for the link Salmakis.
But I want to remain in the "standard" monkey area as much as possible.

My game is not very complicated .I will post it sooner.
that's why I'm very surprised that such game is so slow on Safari (and absolutely not on firefox).

I have seen that list could be a problem. So I convert the list to an array. But still the same problem.

Is there something not well managed by Safari and so to avoid ?
that's my question :-)

Cheers

Pit


k.o.g.(Posted 2015) [#4]
use my (posted by Pharmhaus) pull request: https://github.com/blitz-research/monkey/pull/67

OnCreate
		Local l:List<String> = New List<String>
		Local enum:Enumerator<String> = l.ObjectEnumerator()
		Local obj:String


OnRender
		enum.Reset()
		While enum.HasNext()
			obj = enum.NextObject()
		Wend


So it creates only one Enumerator and not on each Frame one.

Maybe it helps you...


k.o.g.(Posted 2015) [#5]
*double post*...


muddy_shoes(Posted 2015) [#6]
If you look on http://arewefastyet.com/ you'll see that Safari lags behind FF and Chrome on a large number of javascript benchmarks. However there's no way of telling what is causing issues with your game and suggesting possible remedies without profiling your game on Safari.


nikoniko(Posted 2015) [#7]
Test with Chrome. Try to disable (or may be enable) hardware acceleration in Safari.
Do profiling your code. This issue probably relates to css/canvas implementation.


pit(Posted 2015) [#8]
Thanks all.

I will look at your suggestions !

Pit


Gerry Quinn(Posted 2015) [#9]
If you use a lot of text, Angelfont can be rather slow.

Also, colorising images (drawing images with the colour set other than 255,255,255) is a well-known bugbear with HTML.

(And yes, one can often want to combine the two!)

Anyway, if you do a lot of those, that may well be where the problem lies, and there are generally things you can do to reduce the workload,