HTML5 performance

I am playing around with the latest build Solar2D-Windows-2022.3664 and tried the HTML5 export.

The build works and the app is running, but the performance is terrible.
Even if I just move one single image over the screen, the movement is choppy.
It looks like 30fps to me, even if 60fps is set (display.fps says so).

Is there a known hard FPS limit in HML5 builds? Has anyone experienced the same?

I tried it both locally with xampp and on the Solar2D Playground.

If you want to try it yourself, just use this code

local logo = display.newImage(“img/alter.png”)
logo.x = display.contentWidth * 0.5 - 200
logo.y = display.contentHeight * 0.5

function forward()
transition.to(logo, { time = 2000, x = display.contentWidth * 0.5 + 200, transition = easing.inOutQuad, onComplete = backward } )
end

function backward()
transition.to(logo, { time = 2000, x = display.contentWidth * 0.5 - 200, transition = easing.inOutQuad, onComplete = forward } )
end

forward()

Hi!
I tried your example and also exported example projects (eg Corona Cannon). And everything works fine for me. Later, I will post the exported project on itch.io so you can check how it works.
You can try running the lighting demo in your browser: Downloading: dynacam
You can also try working in the sandbox: https://playground.solar2d.com/

Thanks for the reply.

Just to avoid confusion: The problem is NOT that the program is not running. It builds and runs, but it runs SLOW / CHOPPY for me. I already tried the Solar2D playground, and my example program is also slow there.

For comparison, try to run my example in playground and in corona simulator simultaneously (with a config file that sets fps = 60) for a side to side comparison. If I do this, I can clearly see the image move much smoother in the simulator than in the playground.

I’m agree with you.
html5 version rarely runs at 60fps. I thought it was a limitation of browsers

I posted examples of two projects to test the work in the browser on the itch.io platform.
Corona Cannon - Solar2D - Cannon - TechDemo by E1e5en
Test html5 - Solar2D - Test Html5 Perfomance by E1e5en

To display values (FPS, Memory) I used the ponywolf library.

In my Chrome browser the results are:
chrome_1j5BGhHvH7 chrome_k9HsdzE3iY

Share your results please. It will be useful to know that the Web platform is important to me and I would be interested to know how it works for you.

chrome-capture-2022-1-21 (1)
chrome-capture-2022-1-21

Same behaviour here. The FPS switches back and forth btween 30 and 58 fps. Its strange that its only those two values. I did not have a closer look at the implementation yet.

1 Like