# Poor instance performance on Firefox

**URL:** <https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736>\
**Category:** Questions\
**Created:** [July 2, 2024, 8:57am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736 "2024-07-02T08:57:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 2, 2024, 8:57am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/1 "2024-07-02T08:57:21Z")

</div>

Hey there!

I noticed regular instancing is very slow on Firefox. I am using Windows with a good cpu and I get 30fps on this PG on firefox while Chrome is at a stable 60fps:

> **[Babylon.js Playground](https://playground.babylonjs.com/#c2ynt9%2312)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Does someone reproduce this behavior?

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [July 2, 2024, 9:00am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/2 "2024-07-02T09:00:07Z")

</div>

> [@CrashMaster](#):
>
> Does someone reproduce this behavior?

I’m running Ubuntu 22.04 and indeed even on my side there is a big diff. Running at a solid 120 fps on Chrome, and oscillating between 30 fps and 70 fps in Firefox

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 2, 2024, 9:04am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/3 "2024-07-02T09:04:15Z")

</div>

I did a performance profile and couldn’t find anything unusual. Maybe firefox is just slower somehow? 🤔

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [July 2, 2024, 9:15am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/4 "2024-07-02T09:15:02Z")

</div>

I guess it’s happening at a lower level, which is the direct approach of these browser toward JS engine and WebGL bindings, which are not exactly the same…

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [July 2, 2024, 10:46am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/5 "2024-07-02T10:46:23Z")

</div>

> [@Tricotou](#):
>
> happening at a lower level

Yup, that’s weirdo. Never noticed this but I suppose you’re right. Kind of makes me feel of the difference between using instances and thin instances on lower end cpu/gpu (where the lower end performs better with instances than thin instances). I think you should cc this to the Team, may be @RaananW ?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 2, 2024, 11:29am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/6 "2024-07-02T11:29:19Z")

</div>

I can’t quite reproduce, but chrome tends to perform better than firefox.  
Would be interesting to know what renderer is used in both browsers when you are using them. Is it only happening with instances, or is it apparent with other scenes as well?

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 2, 2024, 11:47am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/7 "2024-07-02T11:47:00Z")

</div>

It is definitely not as noticable in other contexts, but I agree that Chrome is generally faster than Firefox.

For the renderer, they both use the WebGL2 renderer with the latest BabylonJS version

---

<div class="post-metadata">

**Author:** ![Maiu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/maiu/32/44046_2.png) [@Maiu](https://forum.babylonjs.com/u/Maiu)\
**Post date:** [July 2, 2024, 11:53am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/8 "2024-07-02T11:53:28Z")

</div>

@CrashMaster I recently discovered that in firefox Parallel shader compilation is not supported. I’m using popOs, and 4500u CPU with integrated graphic card. On Chrome it’s supported

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/7/778d7884c2bbd93bee8fb50bba30aed92f3d05af.jpeg)  
Perhaps this is the case?

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 2, 2024, 11:56am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/9 "2024-07-02T11:56:53Z")

</div>

Interesting! But then I would expect the framerate to increase at some point when all shader compilation is done 🤔

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 2, 2024, 3:29pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/10 "2024-07-02T15:29:40Z")

</div>

MacBook Pro m1 max, OS Sonoma 14.4.1 here.

Firefox 127.0.2 - **40-50 FPS**  
Chrome 125.0.6422.77 (Official Build) (arm64) - **120 FPS**

Bullshit confirmed.

EDIT: I switched back to Firefox to close it and it was running at 100 FPS. Restarted it and it is stuttering at the beginning and after 10 seconds it runs w/o stuttering but still at lower FPS as in Chrome.

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [July 2, 2024, 3:33pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/11 "2024-07-02T15:33:01Z")

</div>

Same, it’s quite weird, honestly I wonder how OpenGL bindings are done on Firefox side. What I cannot understand is the **variability** on Firefox side.

For example (still Ubuntu 22.04) I have this [GPU Particles Experiment](https://gpu.tricotools.com/) that I carry everywhere to test some configs… It’s really pure WebGL here, no Babylon, even the physics compute is on GPU (rendering custom textures to handle position, velocity, pressure, etc) so it’s a good way to test pure GPU side…

- Chrome : Static 120 fps (and the FPS is not targeted, the `update` function is directly calling a `requestAnimationFrame(update)` at the end of itself)
- Firefox : Totaly chaotic frame rate jumping from 60 to 140 fps over time (and I’m running an average on 30 frames, the actual framerate is even more chaotic). WTF is Firefox doing, good question ^^

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 2, 2024, 3:35pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/12 "2024-07-02T15:35:02Z")

</div>

Now this is getting weird:  
with the particles stuff I get maxed FPS in both browsers 😃

---

<div class="post-metadata">

**Author:** ![shaderbytes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shaderbytes/32/174_2.png) [@shaderbytes](https://forum.babylonjs.com/u/shaderbytes)\
**Post date:** [July 2, 2024, 3:58pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/13 "2024-07-02T15:58:11Z")

</div>

i get 60fps in both chrome and firefox for the particles experiment

For the OG’s PG ,

chrome is 60

firefox stutters as it builds the scene. it starts at 60 , as spheres are being added it starts to drop , 50’s , then 40’s then 30’s and at that point all sphere are generated the stutter stops and it runs at 60 smoothly.

---

<div class="post-metadata">

**Author:** ![shaderbytes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shaderbytes/32/174_2.png) [@shaderbytes](https://forum.babylonjs.com/u/shaderbytes)\
**Post date:** [July 2, 2024, 4:21pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/14 "2024-07-02T16:21:08Z")

</div>

so if you comment out the material freeze line :

`//clone.material.freeze();`

and hit play it seems to not have that slow down , i dont save and refresh the browser , i just hit the play button again and again.

then uncomment it , and I see the behaviour described in my post above coming back … slow down as spheres are added , 50’s , 40’s , 30’s … then running normal…

i tested doing this several times each time with it commented out or not and it does seem to be the main culprit , but I have no idea why. i just took a lucky guess testing changing the code a little and noticed this pattern.

---

<div class="post-metadata">

**Author:** ![oriongu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/oriongu/32/40402_2.png) [@oriongu](https://forum.babylonjs.com/u/oriongu)\
**Post date:** [July 3, 2024, 8:56am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/15 "2024-07-03T08:56:28Z")

</div>

I’ve noticed a clear fps difference between Firefox and chrome on my project too. No idea why though

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 9:32am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/16 "2024-07-03T09:32:41Z")

</div>

Because Chrome is a Ferrari and Firefox a Volvo 😃

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 3, 2024, 9:44am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/17 "2024-07-03T09:44:52Z")

</div>

That’s probably the explanation for the problem. It is just sad that Firefox can’t compete with Chrome on so many areas 😕

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 9:52am UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/18 "2024-07-03T09:52:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/2/32a3ded07c47fc5c5ea3261ca707e90a73437c1c.png)

No way bro 😃 😃 😃 Thx!

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [July 3, 2024, 12:47pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/19 "2024-07-03T12:47:16Z")

</div>

I imagine a random guy, later on… Having an issue with Firefox, finding this topics which name matches exactly his issue, sees it at "Solved ✔ ", can’t way to see the solution, and reads “Because Chrome is a Ferrari and Firefox a Volvo” 😂

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 3:32pm UTC](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736/20 "2024-07-03T15:32:36Z")

</div>

This is really a good one! LOOOOOOL

[Next page](https://forum.babylonjs.com/t/poor-instance-performance-on-firefox/51736.md?page=2)
