artofnothingness / mppic

MIT License
84 stars 19 forks source link

Optimizations: Part 4 #87

Closed SteveMacenski closed 1 year ago

SteveMacenski commented 1 year ago

Moving sum to immediate speeds things up quite a bit, which various documentation on xtensor also shows.

Evaling on the path align critic also helps uniquely to that critic, I suspect because of the manual looping calls only some of the values and computed at-time so it doesn't get to use vectorization optimizations.

The approximate atan2 also helps lower the runtime of the atan2 operation by about 2x steady state and its contribution to jitter. I see you have a PR implementing it differently, which I'll test, but this does not change the existing behavior and improves things quite a bit. There's still contribution to jitter, but usually on the order of 2-4ms where before it could get upwards of 6-10 (the rest is probably the cosine or hypot). Doesn't help with any other sources of jitter. Incremental progress.

Removed dt, as it is never used or referenced