I'm playing with Box2Dweb and HTML5 canvas, and are experiencing some odd behaviour. I have one dynamic body and one static body, in the world. I can control the dynamic one with my keyboard.
But as soon as these two collide, I dip from 60 fps to 17, and I cannot move the dynamic body any more (due to the lag, it bearly moves).
I have try profiling it using Firebug, and you can see the result here: https://i.sstatic.net/PLHvG.png
As you can see, it's almost just Box2D taking up time here; my own rendering/clearing/processing functions aren't even listed until like 0.1% in the table.
If you want any sample-code, tell me! I have found other people with the same problem here and here, but they didn't get any answer. So I'm giving it another try!
I found the problem! It is related to the PPM (Pixels Per Meter).
It turns out I was setting it to pretty low (32), and when I increased it to 192, everything runs smoothly again! Thank god. Hope that this can help other people!