box2d.js icon indicating copy to clipboard operation
box2d.js copied to clipboard

Fork with support 2.3.1 version of Box2D and debug output

Open dmagunov opened this issue 11 years ago • 7 comments

Hello guys,

Please check my updates to Your project with support of latest Box2D library and debug output:

source code | demo | article

Thanks!

dmagunov avatar Dec 26 '14 23:12 dmagunov

Nice work!

Is there a performance difference? Seems very similar to me.

Should we merge this in?

kripken avatar Dec 29 '14 19:12 kripken

Thanks!

I also don't see any performance difference. It would be nice to merge this into the main branch. If you would need any help, please let me know.

dmagunov avatar Dec 30 '14 10:12 dmagunov

Great work @dmagunov - and thanks for the article. I know this is old, but I'm getting a significantly better frame rate with box2dweb (on the domino tower). Anybody know why that might be? From what I've heard it should be the other way around, right?

josephrocca avatar Feb 01 '16 14:02 josephrocca

That does seem surprising - do you have links to parallel demos showing that?

kripken avatar Feb 01 '16 18:02 kripken

By parallel demos, do you mean these (provided by @dmagunov above)? http://argadnet.com/demo/rube_testbed/box2dweb/index.html http://argadnet.com/demo/rube_testbed/box2djs/index.php

Weirdly enough, the domino tower one is now running at about the same fps for both. It may have something to do with the way each library handles memory, because my computer was a little starved for RAM (due to other applications hogging it) when I last tried. That's just a guess though

josephrocca avatar Feb 02 '16 14:02 josephrocca

Thanks, sorry I missed those links before.

Profiling domino tower now, I see most time in the box2dweb version in draw, and in the box2d.js version in drawPolygon. In other words,

  1. Most time in both demos seems to be spent in drawing, not physics - which makes sense, as it's rendering a lot of small objects, using canvas2D which tends to be slow at that.
  2. But the different methods also appear to be in different files - they are not rendering using a parallel, shared renderer?

Overall, those suggest to me that at least for domino tower, this is mostly benchmarking the rendering systems, not the physics systems.

kripken avatar Feb 02 '16 22:02 kripken

Ahh, good spotting. If only we had a nice physics abstraction layer to do some proper tests (particularly interested in how p2 compares to your box2d port)

josephrocca avatar Feb 03 '16 04:02 josephrocca