# Slow loading of GLB files with textures compared to Threejs

**URL:** <https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730>\
**Category:** Questions\
**Tags:** performance, glb, textures\
**Created:** [May 12, 2023, 7:21am UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730 "2023-05-12T07:21:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johannes/32/32153_2.png) [@Johannes](https://forum.babylonjs.com/u/Johannes)\
**Post date:** [May 12, 2023, 7:21am UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/1 "2023-05-12T07:21:02Z")

</div>

Hello together,

I am currently trying to reduce the loading time of a scene with about 30 materials. Some have textures, some do not. Unfortunately I noticed that the GLB file loads much faster with Threejs (almost instantly) compared to Babylonjs (~5-6 seconds).

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

The easiest way to reproduce the problem is to open the GLB file in [https://gltf-viewer.donmccurdy.com/](https://gltf-viewer.donmccurdy.com/) versus [https://sandbox.babylonjs.com/](https://sandbox.babylonjs.com/)

I was able to isolate the problem and think it must have something to do with the textures. When I delete the textures the model loads very fast, as soon as I add textures to the materials the problem occurs.

I have reduced the size of the textures and they are all saved as jpg.

Now my question: how can I achieve approximately the same fast loading times as with Threejs?

Tested with MAC Apple M1 Max / Firefox 114.0b2 (64-bit)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 12, 2023, 8:41am UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/2 "2023-05-12T08:41:19Z")

</div>

This sounds like a bug to me and 5-6 s is huge ☹

Could you share a model that repros your issue ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 12, 2023, 9:44am UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/3 "2023-05-12T09:44:39Z")

</div>

I don’t reproduce on Windows. Whether it is the sandbox or the Three.js viewer, on Chrome it loads between 1s-2s and on Firefox between 2s-3s.

@sebavan The file url is inside the PG.

---

<div class="post-metadata">

**Author:** ![Johannes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johannes/32/32153_2.png) [@Johannes](https://forum.babylonjs.com/u/Johannes)\
**Post date:** [May 12, 2023, 11:29am UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/4 "2023-05-12T11:29:29Z")

</div>

Thank you for your support!

The file:  
[test.glb.zip](https://forum.babylonjs.com/uploads/short-url/iNtMYQB0DGsefiVrM6d3FdNa848.zip) (1.2 MB)

I made a small screen capture to visualize the problem better:

[https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/a/0a6006f12f74aa306937c40c6f85ac77116b862e.mp4](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/a/0a6006f12f74aa306937c40c6f85ac77116b862e.mp4)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 12, 2023, 6:55pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/5 "2023-05-12T18:55:12Z")

</div>

I do not repro it either ☹ I hope we ll be able to soon put our fingers on this one 🙂

@Johannes can you share a perf capture from when you load ? we should see the culprit there

---

<div class="post-metadata">

**Author:** ![Johannes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johannes/32/32153_2.png) [@Johannes](https://forum.babylonjs.com/u/Johannes)\
**Post date:** [May 12, 2023, 8:10pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/6 "2023-05-12T20:10:45Z")

</div>

I am calmed that the problem only occurs with my setup. If it only loads slowly on Mac with Firefox, it doesn’t seem so bad.

 ![Loading Profile](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/0/c06e61ce4de201ffe4a0a0e490ab8cabca7fa1ee.png)

 ![Loadin Profile 2](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/1/e1b2fa5ff6b2abbbcebdeffe2ab149c3b3df0f45.png)  
Unfortunately I don’t know if this helps to identify the problem?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 12, 2023, 8:49pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/7 "2023-05-12T20:49:59Z")

</div>

This refresh driver tick at the bottom could be the reason ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [June 12, 2023, 2:08pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/8 "2023-06-12T14:08:38Z")

</div>

@Evgeni_Popov this isn’t related with the other slow initialization issues which were a chromium problem right?

---

<div class="post-metadata">

**Author:** ![qq2315137135](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qq2315137135/32/32219_2.png) [@qq2315137135](https://forum.babylonjs.com/u/qq2315137135)\
**Post date:** [June 12, 2023, 2:27pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/9 "2023-06-12T14:27:42Z")

</div>

In fact, I think it may be the effect of environmental mapping.  
It seems that gltf-viewer does not load an environment map by default.  
Maybe he defaults to the spherical harmonic factor for ambient lighting?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 12, 2023, 2:52pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/10 "2023-06-12T14:52:49Z")

</div>

> [@carolhmj](#):
>
> @Evgeni_Popov this isn’t related with the other slow initialization issues which were a chromium problem right?

I’m not sure what other initialization issue you are referring to(?)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [June 12, 2023, 3:08pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/11 "2023-06-12T15:08:22Z")

</div>

This one: [1448494 - Loading issue… (chromium.org)](https://bugs.chromium.org/p/chromium/issues/detail?id=1448494)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [June 12, 2023, 3:16pm UTC](https://forum.babylonjs.com/t/slow-loading-of-glb-files-with-textures-compared-to-threejs/40730/12 "2023-06-12T15:16:04Z")

</div>

It’s hard to say, but I’d say that’s not the problem because I couldn’t reproduce the problem reported in the current thread, whereas I did for the SSR one.
