Hi, I developed several games using P5.js and I managed to make them work around 60fps. Sadly, I discovered that they’re working around 10fps on a lot of browsers including recent versions of chrome and safari.
Here is a very short sketch that display framerate.
The sketch that you linked to gives me a rate of 60fps on both chrome and firefox. Maybe that’s oversimplifying your games sketch? Do you have nested for loops in your game where you’re making a lot of comparisons for collision detection perhaps? That could slow down your sketch by a lot.
Hi, thanks for your answer !
The browsers that give me a low frame rate can’t run this sketch either at more than 9fps in full page (latest builds of chrome and safari for me), almost the same as for my games.
Which version of chrome are you using ? Mine is 66.0.3359.181.
Just in case, here is an example of a full game I did : https://martiansparlor.itch.io/191
Hi @bmoren. I’m glad to see that most people here can run the sketch correctly. Which version of chrome are you using ?
I noticed that the issue doesn’t seems to be related to the sketch itself since the browsers who can run this one can also run my games with almost the same framerate. You can try this game made in p5 for example, the frame rate is not displayed in it but you can see if the game run well (it is supposed to be really quick).
What I understood so far is that the newest version of chrome and safari can’t run any of my sketches at more than 9fps when the window is large, it can go up to 60fps if the window is really small. Firefox and waterfox doesn’t seem to be concerned so far.
191 runs very fast and fluid for me on 66.0.3359.181 (Official Build) (64-bit).
This sounds like you could possibly be experiencing a general browser issue that isn’t Processing-specific. For example, you might have a ram-hogging plugin installed? Have you tried other non-Processing-specific resource intensive JavaScript games in that browser?
Hi @jeremydouglass. Thanks for testing 191°
Now the framerate is ok on my chrome browser. Since I didn’t make any change, I suspect some browsers to have a different way to work with memory. Maybe the activity on the computer behind could be involve ?
Yes – your computer has limited RAM, and you have a lot of browser tabs open or are running a lot of different applications in the background then your application may slow down.
On the framerate app it hovers around 11 or so fps but it is highly eratic going from 30 to 7 back to 20 rapidly. On the game the frame rate is between 1-9, often freezing or dipping below 1fps.
But if so, why is it depending of the browser ? I’m talking about a gap from 60fps to 8fps depending of the browser. And why a simple sketch as the one I posted can give 8fps in full page and 60 in a very small window ? Thanks for your answer btw
Just noting that I get the same issue on chrome with the framerate sketch.
It works at ~60 fps on firefox, but only around ~15 fps on full screen chrome. If I reduce the size of the Chrome window, it seems to speed up to around ~45 fps.
Your 191 game works on Chrome, but is clearly lagging for me. Runs perfect in Firefox.
I was having performance problems with p5.js sketches on my El Capitan Macbook Pro, but resolved them by upgrading to High Sierra. Here is a link to the thread:
On my mobile phone I’m getting 8-11 fps with that simple framerate sketch. The phone is a LG G5 using Android 8.0.0 with both Chrome 70.0 and Opera Mini v37.1
Was there any progress made on why this is running so slow?
I was wondering why my own sketch was running so slow, but if my phone can barely get the framerate sketch at 10fps there’s no reason to expect my sketch to run any faster.