4 ms·
Can confirm the poor performance on small matrices (less than 20x20). This is a problem particularly for robotics applications when your entities are positions,
by markisus 5y ago
Can confirm the poor performance on small matrices (less than 20x20). This is a problem particularly for robotics applications when your entities are positions, velocities, etc.
https://stackoverflow.com/questions/58071344/is-eigen-slow-at-multiplying-small-matrices https://stackoverflow.com/questions/58071344/is-eigen-slow-a...
- justshowpost 5y agoNo estoy de acuerdo con tus politicas
- szundi 5y agoAn other answer just debates wether that was a benchmarking issue
- markisus 5y agoMultiple other users confirmed the results and that one answer's author never followed up.
- Const-me 5y ago> when your entities are positions, velocities, etc. For use cases where FP32 precision is enough, I usually use DirectXMath library https://github.com/Microsoft/DirectXMath https://github.com/Microsoft/DirectXMath for that. That thing is cross-platform in practice. Even when building things for ARM Linux, it’s easy to copy-paste required pieces, NEON support is there. When I need FP64 precision on PCs, I usually proceed without libraries, using AVX intrinsics.
- wbthomason 5y agoHuh, interesting - this is news to me, as I use Eigen all the time/see it used all over for robotics. Is there a good replacement for robotics-specific operations/small matrices generally (I see some people mentioning DirectXMath?)? Or is the tradeoff just between spending the time and effort to write SIMD intrinsics yourself vs. lower performance but greater convenience with Eigen? One advantage of Eigen's approach that I haven't seen mentioned here is that its templated design makes it easy to substitute custom scalar types for operations, which helps enable straightforward automatic differentiation and other such tools (e.g. I'm currently using Eigen to make a tracing JIT for computations like FK, etc. over scenegraphs).
- jeffreygoesto 5y agoBlaze [0] looks promising. There was a little discussion here [1] about it's comparison and performance, especially for small sizes. [0] https://bitbucket.org/blaze-lib/blaze/src/master/ https://bitbucket.org/blaze-lib/blaze/src/master/ [1] https://bitbucket.org/blaze-lib/blaze/issues/266/blaze-vs-eigen https://bitbucket.org/blaze-lib/blaze/issues/266/blaze-vs-ei...
- wbthomason 5y agoThanks, this looks promising indeed! Especially because it similarly supports custom scalar types: https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20and%20Matrix%20Customization#!custom-data-types https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20and%20Ma...
- wbthomason 5y agoOne small downside of Blaze vs. Eigen for robotics is that Blaze seems to lack the highly convenient geometry types and operations that Eigen ships with. This wouldn't be difficult to build on top of Blaze (and could lead to some interesting performance comparisons), but does present some additional work necessary to use Blaze in many robotics applications.
- blt 5y agoglm is also good for 3d math. It mimics the API of OpenGL shaders, so it's a good option if you already know how to write shaders (or are interested in learning). https://github.com/g-truc/glm https://github.com/g-truc/glm