utilities icon indicating copy to clipboard operation
utilities copied to clipboard

Investigate System.Numerics and SIMD capable types

Open paulcscharf opened this issue 6 years ago • 4 comments
trafficstars

Since we use many of our own types, we might be able to use vector and matrix types from System.Numerics instead of OpenTK types which may result in significant speedups with calculations.

We should look into this!

paulcscharf avatar Jan 20 '19 11:01 paulcscharf

I assume we would be using this as underlying types. Would we still support conversion to OpenTK natively in our library? Alternatively if we can cut out the actual dependencies on OpenTK, we could always consider having the conversions to OpenTK types as extension methods in Bearded.Utilities.OpenTK, making the OpenTK dependency completely optional.

tomrijnbeek avatar Jan 20 '19 11:01 tomrijnbeek

That being said, I am not so sure whether it will be faster than OpenTK types. I've noticed they're really focusing on performance of operations of things like Vector multiplication in that library, so the only way System.Numerics would be faster is if they do some fancy stuff, which I doubt.

tomrijnbeek avatar Jan 20 '19 11:01 tomrijnbeek

They do fancy stuff, yes, they compile to SIMD operations when available. Maybe OpenTK has doing that too, or gonna do at some point, but if so I'm not aware.

paulcscharf avatar Jan 20 '19 13:01 paulcscharf

https://github.com/jackmott/LinqFaster

This library seems to have some optimisations for not just Linq, but also SIMD, in case that was a blocker or something we wanted to consider.

Just leaving this here so we don't lose the linq (pun intended) in the future.

tomrijnbeek avatar Jul 22 '19 22:07 tomrijnbeek