PSA: The thrust vectors for some radially-mounted engines don't point straight down by default. Rotate them to eke more m/s Δv out of your craft.

It's usually less CPU cycles, in reality, and it uses less memory (which means the relevant data is more likely to fit in a cache line, which is VERY important to performance when working in large scales),

Assuming we are working in 2d:

Using vectors requires first subtracting the reference position, adding on the child position, performing a 2d vector rotation, and adding the reference position back on.

Using matrices requires using a 3*3 translation+rotation matrix which means you perform a total of 9 dot products, and each dot product consists of 3 multiply operations and 2 additions.

Using vectors alone require in memory 4 floats to store position (2 for the reference, 2 for the child) + 2 floats for rotation (1 reference, 1 child), and then in terms of operations a total of 3 subtracts (to make the reference the origin, and 1 during the rotation), 5 additions (2 after making the origin, 1 during the rotation, 2 after the rotation), 4 multiplies (for rotation) and a cos and sin function which you can easily store in a lookup table for fast performance.

The matrix approach requires storing 12 floats (8 for rotation and 4 for translation, half for the reference and half the child) which you have to convert into 18 floats (as you need to convert the 23 matrix into a 33). Whether the matrix is row-major or column-major must be considered, as it can have a huge performance impact. Afterwards, you need 9 dot products, which totals 27 multiplication operations and 18 additions.

It's also worth noting that when using SIMD, you typically have a register 256 bits wide. This is enough to store 4 2d vectors and perform their addition/subtraction at once. With matrices you must use 3d vectors, and so can only store 2 3d vectors at once, meaning you are in the end performing more operations and needing to load the vectors into and out of SIMD registers more often.

/r/KerbalSpaceProgram Thread Parent Link - imgur.com