Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMD optimizations #58

Open
karlzwinnen opened this issue Oct 28, 2015 · 1 comment
Open

SIMD optimizations #58

karlzwinnen opened this issue Oct 28, 2015 · 1 comment

Comments

@karlzwinnen
Copy link

As Liquidfun uses SIMD for its particle system, i was wondering if there are any plans to optimize the box2d part as well?

It seems there already is a fork of box2d available which makes use of SIMD (and also enables this for SIMD.js through emscripten): http://peterjensen.github.io/html5-box2d/
The source seems to be hosted here: https://github.com/huningxin/box2d.js/tree/sse

Would it be difficult to merge this back in the box2d core liquidfun uses?

@jsanmiya
Copy link
Contributor

Hey Karizwinnen,

That's a cool fork of box2d. It looks like they optimized a few key
functions with intrinsics
https://github.com/huningxin/box2d.js/blob/sse/Box2D_v2.2.1/Box2D/Dynamics/Contacts/b2ContactSolver.cpp#L674,
so yes, it seems possible to pull that in, although we'd have to ensure it
works for all platforms, not just Intel processors.

That being said, I think it's nice to stick as close as possible to
official Box2D releases (currently we're based on the 2.3.0 release of
Box2D). This way, people can use LiquidFun as a drop-in replacement.
Pulling in code from other places increases the chance that we'll introduce
a deviation.

One thing to note: their SIMD optimizations use SSE
https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions, so they're for
Intel and AMD chips. LiquidFun's SIMD assembly code is for NEON
http://www.arm.com/products/processors/technologies/neon.php, so for ARM
chips. So they're optimizations for different platforms. Still useful, but
slightly different.

On Wed, Oct 28, 2015 at 8:30 AM, karlzwinnen notifications@github.com
wrote:

As Liquidfun uses SIMD for its particle system, i was wondering if there
are any plans to optimize the box2d part as well?

It seems there already is a fork of box2d available which makes use of
SIMD (and also enables this for SIMD.js through emscripten):
http://peterjensen.github.io/html5-box2d/
The source seems to be hosted here:
https://github.com/huningxin/box2d.js/tree/sse

Would it be difficult to merge this back in the box2d core liquidfun uses?


Reply to this email directly or view it on GitHub
#58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants