canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Typical performance using webgl with this plugin.

Open implicit-invocation opened this issue 4 years ago • 10 comments
trafficstars

I made a simple bunny-mark test using WebGL API, ran the app on an iPhone X, and only got stable 60fps at ~800-900 bunnies.
The same source code can easily run 60fps on safari with more than 10000 bunnies.

Is that the typical performance we can get? Or am I doing something wrong?
My example is using an in-house rendering engine. It can be the problem. But did anyone run pixijs bunny-mark using this plugin?

implicit-invocation avatar Aug 16 '21 20:08 implicit-invocation

Thanks for this , I have a couple ideas on how performance can be improved .

triniwiz avatar Aug 16 '21 20:08 triniwiz

It's probably the individual draw calls that come with a lot of overhead. I found shaders alone to run well, so the issue probably lies on the javascript side. Have you profiled it?

Mwni avatar Aug 16 '21 20:08 Mwni

It's probably the individual draw calls that come with a lot of overhead. I found shaders alone to run well, so the issue probably lies on the javascript side. Have you profiled it?

I profiled it when running on the web. Almost no JS overhead. No GC stuttering (everything is initialized at load time).
The draw call is batched and use drawElements on indexed vertices.
I'm new to NativeScript so maybe I will learn how to profile directly on the app to see the difference.
But I suspect that the reason has something to do with how the call is bridged.
Or is there a dev/production switch that I need to turn?

implicit-invocation avatar Aug 16 '21 20:08 implicit-invocation

I'll check out that demo 🙂

triniwiz avatar Aug 16 '21 20:08 triniwiz

You can profile directly using Xcode or Android Studio, just open the project in the respective editor.

Mwni avatar Aug 16 '21 20:08 Mwni

that bridge 😁

VanderSP avatar Aug 16 '21 20:08 VanderSP

I increased my batch size to 10920 vertices, safari could spawn 60000 bunnies at 60fps. This plugin got to 1200 bunnies.
I tried running on ejecta, I could get 4000 bunnies before the frame drops.

implicit-invocation avatar Aug 20 '21 21:08 implicit-invocation

@implicit-invocation can you try again 😄

triniwiz avatar Aug 30 '21 15:08 triniwiz

@implicit-invocation can you try again 😄

OK, I will try again tomorrow.

implicit-invocation avatar Aug 30 '21 15:08 implicit-invocation

android😁android😁android😁android😁android😁android😁android😁android😁android😁android😁android😁android😁

VanderSP avatar Aug 30 '21 15:08 VanderSP

Performance has been improved in v2

triniwiz avatar Aug 22 '24 11:08 triniwiz