fleabay said:
One of the biggest reasons for me to use GLM is its automagic (I think) SIMD support.
Repeating my findings when implementing fluid simulator (which i have already posted one or two times here)โฆ
I've used GLM initially, because it has similar syntax to the open source stuff i had used as reference.
Later i have replaced GLM with two things:
Sonys old SSE2 simd vector math lib which came with Bullet Physics (not sure if that's still the case.)
This gave me a speedup of more than three!
But not because of SIMD. Sonys lib also has a non SIMD version, which was only 10% slower. Meaning MSVC became better with auto vectorization, as it seems.
Then i also replaced glm::ivec3 with int[3]. This was used mainly to index grids here and there, and i did not expect any change in performance at all. But i got another overall speedup of 3, which is unbelievable.
So, in the end i got a speedup of 10, just by replacing GLM. I don't know the reason. Profiler showed many samples went into GLM constructors, but i did not look any further. Would be interesting to see how's it with Clang, but i never tried to set this up with VC yet.
We know GLM is not meant to be fast. But from my experience i can not recommend to use it at all. At least not as core math lib for games.