Dropped render frames

So I am creating a game using babylonjs, however I noticed that sometimes the babylonjs engine appears to drop frames as shown in the image below:


This is an image of outputs that I am outputting once every frame, the numbers correspond to engine.getDeltaTime() so for 60fps the delta time should be around 16.66666 . As you can see the game will be running along nicely at 59/60 fps and then all of the sudden the delta time will jump up to 32/33 for a frame or two and then return to normal. These quick lag spikes as you can probably predict absolutely ruin the game-play and happen about once every 500 frames so they are relatively spaced out. I have been all over my code trying to figure out what is causing this including removing almost all the meshes from my scene, disabling the physics engine, collisions were already off. There are only a total of about 1000 vertices in the entire scene with no custom shaders or procedural generation and I am doing no major mesh creations/destructions. It is as bare bones as I can make it and still I get these spikes. I obviously can not post all my code in here and it is late for me so I can’t make a playground at this time but I can tomorrow assuming no one knows an obvious answer, in the mean time I was wondering if anyone knows from experience what would be causing this. The spikes are always 32/33 when they should be 16ish which makes me think the engine is intentionally dropping/skipping a frame instead of normal lag with just a delayed frame which is what I found so unusual about this case. Again if anyone thinks a playground would help address this issue please let me know.

You could maybe check if garbage collection is the culprit in the browser dev tools. It is often the reason and in this case you could benefit from the toRef vector/matrix manipulation helping to reduce it.