# Can we run Havok inside a Web Worker?

**URL:** <https://forum.babylonjs.com/t/can-we-run-havok-inside-a-web-worker/45037>\
**Category:** Questions\
**Created:** [October 19, 2023, 9:04am UTC](https://forum.babylonjs.com/t/can-we-run-havok-inside-a-web-worker/45037 "2023-10-19T09:04:15Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [July 27, 2024, 3:59am UTC](https://forum.babylonjs.com/t/can-we-run-havok-inside-a-web-worker/45037/13 "2024-07-27T03:59:25Z")

</div>

Here’s currently what I have:

- Static ground (gray) and ramp (red)
- Kinematic platform (green)
- Dynamic boxes (yellow) and 3rd-person player (blue)

There are 1000 always-active dynamic yellow boxes that can collide with each other

A `SharedArrayBuffer` is used to share data between the main thread and the Web Worker

H̶a̶v̶o̶k̶ ̶w̶i̶t̶h̶o̶u̶t̶ ̶W̶o̶r̶k̶e̶r̶

H̶a̶v̶o̶k̶ ̶w̶i̶t̶h̶ ̶W̶o̶r̶k̶e̶r̶

**EDIT: Please watch videos in the [post below](https://forum.babylonjs.com/t/can-we-run-havok-inside-a-web-worker/45037/15) instead**

I’m on a rather old laptop, and recording with OBS Studio definitely caused a hit to performance. As shown in the videos, the FPS was

- ~30 without Worker
- ~90 with Worker

However, the physics step compute time was noticeably slower in a Worker with OBS Studio recording. It’s ~10X faster without OBS Studio recording

You may also notice that the physics is slowing down as it’s struggling to keep up with realtime - related to our chat in [your post](https://forum.babylonjs.com/t/havok-strange-behaviour-when-switching-tabs-on-last-versions/51618/4), @riven04 🙂

---

_[View the full topic](https://forum.babylonjs.com/t/can-we-run-havok-inside-a-web-worker/45037)._
