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

Would optimizing with SIMD friendly typed lists work? #89

Open
antont opened this issue Oct 13, 2023 · 0 comments
Open

Would optimizing with SIMD friendly typed lists work? #89

antont opened this issue Oct 13, 2023 · 0 comments

Comments

@antont
Copy link

antont commented Oct 13, 2023

EDIT: just realized the this already uses vector_math for the types, just not in arrays. I could experiment and see if it affects the perf, I think it does via memory layouts.


Hi, and thanks for the nice package, we just started using it and the perf is probably fine for the 100 particles we use now.

However I'm curious, would it work to optimize this by making the particle positions and velocities SIMD friendly typed lists, and using array operations to apply the updates to those in one go? I think that's how particle systems are often made, and how e.g. numerical python achieves great performance with array operations.

I could try this out for fun, also to learn a bit for Dart and Flutter, if it would make sense.

Am thinking the particle data arrays could use https://api.dart.dev/stable/3.1.3/dart-typed_data/Float32List-class.html

And maybe use this lib for operations,
https://pub.dev/documentation/vector_math/latest/vector_math_operations/Matrix44SIMDOperations/multiply.html

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

1 participant