mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
774 stars 70 forks source link

A bunch of micro-optimizations in the adapter #3804

Closed pleroy closed 1 year ago

pleroy commented 1 year ago
  1. Avoid double conversions (e.g., Vector3Vector3dXYZ).
  2. Use local variables to hold nontrivial expressions.
  3. Disable physics auto-sync over a larger region.
  4. Do a bit less work in the marshallers (notably, less allocations).

None of that makes a big difference. Optimistically, this PR brings a 10% speed up in the test case of #3230.