Major drop of FPS when upgrading beta.2 to beta.3


Wondered maybe any of you guys had the same problem, I see a major drop of FPS when upgrading @babylon/core@4.0.0-beta.2 to @babylon/core@4.0.0-beta.3.
It is especially noticeable on mobile devices (iOS and Android) and scenes with lots of meshes & vertices, but the difference is unmistakable with the exact same scene on beta.2 I see around 40FPS and when upgrading to beta.3 the FPS drops to around 1-3FPS!
The version is the only difference and tested on Samsung S10 (Chrome mobile v73.0.3683.90)

can you try with rc0 ?

Happens on rc0 as well, to be honest, not sure I pinpointed the exact version it happened.
I am sure though, that it never happened in previous versions (before beta.2) but it doesn’t reproduce every time I try on newer versions.

here is a performance snapshot I took, never seen anything like it, any idea what could be the source of such a thing? (50ms~ is somehow reasonable here, but never seen so much time wasted on the GPU)

  • snapshot took on Samsung S10

What the heck ist that GPU profile??? Something is totally wrong here :smiley:

Let’s try some stuff:

  • Try turning webgl2 off
  • Try using engine._shouldUseHighPrecisionShader = false

Thanks :slight_smile:
How do I turn off webgl2 on chrome mobile?

When I set “_shouldUseHighPrecisionShader” I get an error:
Cannot set property _shouldUseHighPrecisionShader of #<e> which has only a getter

Like this:
var engine = new BABYLON.Engine(canvas, true, {disablewebgl2support: true});

1 Like

Thanks, tried with disablewebgl2support: true (and it’s working cause I see in the console Babylon.js v4.0.0-rc.0 - WebGL1) nothing changed, still GPU section takes forever.

Tested on Samsung S10, iPhone 7s & huawei p10

Sorry I meant:

var engine = new BABYLON.Engine(canvas, true, {
disablewebgl2support: true, 
useHighPrecisionFloats: false});

No problem :slight_smile: tried that and didn’t work. any other idea?
Tried to disable shadows and everything works perfectly and everything works perfectly, but I think that’s not a real test cause anyway the shadow calculations are the “heaviest” part.
Tried also to disable reflection probe but this time didn’t have any effect on performance.

can you repro with something in he playground?

Not really, it’s a pretty complex scene, but I can deploy a version that this slow down happens so you can inspect it your self, will it help?
Anyway, I kept on digging and found an interesting thing while inspecting performance on iOS (iPhone s7, safari):

Ok I’ll try something
Can you get the next nightly (in a hour or so) and test it?

1 Like

Sure! how do I do that? (I’m using the ES6 version)

well I cannot deploy a npm update so you will have to use the file directly

(maybe just copy paste it in your node-modules folder where the current one is)

I’m using the ES6 version and transpile the module with webpack while compiling, so I assume that using this version will require lots of changes that might be relevant to this issue. (and will take a while)
Do you think I will be able to build my own version of @babylon/core and use this version (don’t mind to copy paste it just to check if it’s working)? I can’t think of an easier option.

Thanks again!

try to go to babylonjs/core/engines forlder in your es6 npm folder and replace this file: (41.5 KB)

1 Like

Tried that, but didn’t work.
I’m running rc.2 now hope that’s what you expected.

  • Made sure that the new code is deployed (deployed a version with console.log in engine.js and saw it printed)
  • Made a text comparison of rc.2 engine.js and the file you sent and changed to:
                    var offset = data.byteOffset + byteOffset;
                    if (offset || byteLength !== data.byteLength) {
                        data = new Uint8Array(data.buffer, offset, byteLength);
                    } else {

to make sure there is any effect to the changes you’ve made, and didn’t see any logs.

here are two fresh snapshots I took:
chrome mobile on galaxy S10:

safari on iPhone s7:

crap this is not the content you should have.
my version has no if (offset…

I’m publishing a RC for you (RC3)
will be up in 10 minutes or so

it is live