# Using React and Babylonjs efficiency

**URL:** <https://forum.babylonjs.com/t/using-react-and-babylonjs-efficiency/6737>\
**Category:** Questions\
**Created:** [November 1, 2019, 7:41pm UTC](https://forum.babylonjs.com/t/using-react-and-babylonjs-efficiency/6737 "2019-11-01T19:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhiru](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dhiru/32/5213_2.png) [@dhiru](https://forum.babylonjs.com/u/dhiru)\
**Post date:** [November 1, 2019, 7:41pm UTC](https://forum.babylonjs.com/t/using-react-and-babylonjs-efficiency/6737/1 "2019-11-01T19:41:59Z")

</div>

Hi,  
I apologise for a very basic question; I have built a basic scene in Babylonjs using plain javascript and I was wondering if I should start using it with React (and create components instead).  
My question is : does the React’s virtual DOM result in any performance penalty over plain javascript when using Babylon ? – just wondering if I should live with the current code or spend time in creating something re-usable (but not at the cost of efficiency).

I hope my question even makes sense ☹

---

<div class="post-metadata">

**Author:** ![syntheticmagus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syntheticmagus/32/395_2.png) [@syntheticmagus](https://forum.babylonjs.com/u/syntheticmagus)\
**Post date:** [November 1, 2019, 11:09pm UTC](https://forum.babylonjs.com/t/using-react-and-babylonjs-efficiency/6737/2 "2019-11-01T23:09:20Z")

</div>

Hi dhiru,

First of all, welcome to Babylon! I’m not sure I fully understand what you’re suggesting (I’m not super familiar with React in general), but if it’s a performance question, you might be able to analyze it using [Chrome’s built-in performance analysis tools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/). From what I understand, it should be fairly straightforward to set up a simple scene trying things each way—with and without React—then capture a trace that will allow you to compare the performance between the alternatives. Will that work for your use case?

---

<div class="post-metadata">

**Author:** ![dhiru](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dhiru/32/5213_2.png) [@dhiru](https://forum.babylonjs.com/u/dhiru)\
**Post date:** [November 6, 2019, 9:59pm UTC](https://forum.babylonjs.com/t/using-react-and-babylonjs-efficiency/6737/3 "2019-11-06T21:59:51Z")

</div>

Thank you for your reply! – yes that will work! – I guess I was just being lazy ☹ I will need to profile my code and check.  
For some reason, mentally I felt with React Creating a Virtual DOM; the code is bound to weaker performance-wise than traditional javascript with no Virtual DOM – was wondering if anyone benchmark anything like this before.

Thanks!
