# Multiple meshes. How can it be optimized?

**URL:** <https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251>\
**Category:** Questions\
**Created:** [December 7, 2023, 1:59pm UTC](https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251 "2023-12-07T13:59:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Andre](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/olivier_andre/32/36465_2.png) [@Olivier\_Andre](https://forum.babylonjs.com/u/Olivier_Andre)\
**Post date:** [December 7, 2023, 1:59pm UTC](https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251/1 "2023-12-07T13:59:28Z")

</div>

Hello,

I’ve to display a warehouse with 7340 locations (see picture). Each location is generated in my program using Php and each mesh is defined like this:

` box[376258] = BABYLON.MeshBuilder.CreateBox('RS1||376258|4S|.|005|00|E1', { height: 2.4000000, width: 1.2100000, depth: 0.85, topBaseAt: 0 }); box[376258].position = new BABYLON.Vector3(3.10,1.2,14.40);`

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/8/d83a862b880e363500b51c4277521c01273e4de8.png)

Is there any way to improve the rendering speed?

Many thanks.

Olivier

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [December 7, 2023, 3:13pm UTC](https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251/2 "2023-12-07T15:13:00Z")

</div>

If all boxes have the same dimensions you may use Instances or even Thin Instances as described here - [Instances | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances)  
(I would recommend to start with ‘usual’ Instances since they are simpler).  
It also may depend on boxes materials. How much of them do you need for your app?  
So, the first thing is to reduce draw calls number with instancing where possible.  
Currently your PG example has too much draw calls (3077)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/d/2d04eabac117bc2fe69bd84f5a088bc2e6113594.jpeg)  
I believe it should be possible to reduce this number ten times or even more.

Then you may continue with other optimizations like here - [Optimizing Your Scene | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene)

---

<div class="post-metadata">

**Author:** ![Olivier\_Andre](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/olivier_andre/32/36465_2.png) [@Olivier\_Andre](https://forum.babylonjs.com/u/Olivier_Andre)\
**Post date:** [December 7, 2023, 3:30pm UTC](https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251/3 "2023-12-07T15:30:38Z")

</div>

@labris,  
Many thanks for your answer. I’ll try and let you know about the progresses.

Olivier

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [December 7, 2023, 3:34pm UTC](https://forum.babylonjs.com/t/multiple-meshes-how-can-it-be-optimized/46251/4 "2023-12-07T15:34:26Z")

</div>

Don’t hesitate to ask questions! 🙂
