# When drawing a large number of objects in a GUI.Container and performing container movement, the performance becomes very sluggish

**URL:** <https://forum.babylonjs.com/t/when-drawing-a-large-number-of-objects-in-a-gui-container-and-performing-container-movement-the-performance-becomes-very-sluggish/41297>\
**Category:** Questions\
**Tags:** gui\
**Created:** [June 1, 2023, 8:56am UTC](https://forum.babylonjs.com/t/when-drawing-a-large-number-of-objects-in-a-gui-container-and-performing-container-movement-the-performance-becomes-very-sluggish/41297 "2023-06-01T08:56:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 1, 2023, 11:54am UTC](https://forum.babylonjs.com/t/when-drawing-a-large-number-of-objects-in-a-gui-container-and-performing-container-movement-the-performance-becomes-very-sluggish/41297/4 "2023-06-01T11:54:53Z")

</div>

Please keep in mind that GUI utilizes a 2D Canvas [CanvasRenderingContext2D - Web APIs | MDN (mozilla.org)](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) which can really struggle with drawing lots of elements. In a scenario like this, I highly recommend using 3D planes and textures/shaders instead, as they can take advantage of instancing ( [Instances | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances)) to achieve much better performance.

You can see an example of such here, where I compare the use of GUI vs the use of a Node Material Shader for dynamically updating billboards: [Counters with GUI and billboard instances | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#IHGGPZ#10). The approach with GUI hovers over 40 FPS, and increasing the number of objects will quickly make it run out of memory, while the shader approach achieves a solid 60FPS.

---

_[View the full topic](https://forum.babylonjs.com/t/when-drawing-a-large-number-of-objects-in-a-gui-container-and-performing-container-movement-the-performance-becomes-very-sluggish/41297)._
