by Mathnerd314 · 4y ago · 0 comments
> The main cause for the lower performance of GA is the Gaigen’s soft typing of the geometric algebra objects at compile-time: all types of objects (scalars, vectors, bivectors, trivectors, rotors and so on) are represented by a single data type in Gaigen. When a product or operation has to be computed, Gaigen first checks the grade usage of the argument(s) and then acts accordingly. This conditional step between function call and actual computation is largely responsible for the drop in performance.
So, I blame the library. Writing out the 3-4 datatypes for 3D GA by hand as real types costs some development effort but should give equivalent performance.
There's a reason that after decades GA hasn't replaced quaternions, and it's not because people don't know how to optimize code by hand.
My impression is that if you want something compact that you'll need to either give up on performance (type erasure) or separate compilation (track every type).
GA is great for pen and paper proofs though.