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

v0.2.2 minified file is slow

Open finscn opened this issue 7 years ago • 8 comments

http://fatidol.com/phy-benchmark/planck-test.html

it's worse than the old version

finscn avatar Sep 12 '18 09:09 finscn

Sorry to hear that. Do you know which version you used before v0.2.2?

zOadT avatar Sep 12 '18 13:09 zOadT

@zOadT https://github.com/shakiba/planck.js/blob/master/lib/collision/AABB.js#L93-L115 Replace with(for exmaple):

lowerA = a.lowerBound
upperA = a.upperBound

lowerB = b.lowerBound
upperB = b.upperBound

FPS ↑↑↑

JetLua avatar Sep 12 '18 15:09 JetLua

I got it, I will fix it.

shakiba avatar Sep 12 '18 16:09 shakiba

I reverted that change, can you please check it out again.

shakiba avatar Sep 13 '18 07:09 shakiba

It's still slow than old version( v0.2.1 ).

finscn avatar Sep 13 '18 15:09 finscn

@finscn Thanks for sharing your performance reviews. I used your example code with both v0.1 and v0.2.3, I can't see the difference.

Also please note that drawing shapes on canvas is an expensive process. I use stage.js in testbed, it draws shapes to textures and then reuse textures to avoid redrawing shapes in each frame.

shakiba avatar Sep 17 '18 02:09 shakiba

@finscn Can I add your test to examples in this project, or would you like to make PR for that?

shakiba avatar Oct 28 '18 22:10 shakiba

It seems that minified file of version 0.2+ is actually slow!

shakiba avatar Nov 09 '18 05:11 shakiba