I was profiling an application recently that computes access times from a TLE and it spent a significant portion (~14%) of its time in
Transform.compositeRotationAcceleration(...). This seemed odd to me since the computation should only need to transform positions, not velocities or accelerations. The current API for frame transforms always computes transforms with acceleration information. Thanks to Luc’s previous performance work computing the constituent
Transforms is very quick. So much that composing the
Transforms now uses a significant fraction of the computing time. There should also be some potential time savings available from not computing unused derivatives of the transformation in the
So this proposal is to allow the user to request
Transforms that only include the information they need. Specifically three new classes would be added:
StaticTransformthat only transforms positions and vectors
KinematicTransformthat also transforms velocities, extends
DynamicTransformthat also transforms accelerations, extends
Similarly three methods would be added to
getDynamicTransformTo(...). Supporting methods would be added to
TransformProviders would be updated to use the new methods.
Then performance of the new implementation would be compared to the old using JMH to measure it. If the speedup is less than 1.5 (50% faster) the new code would not be merged into Orekit.
Finally all the code in Orekit that uses frame transforms would be reviewed to use the appropriate transform. For example
TopocentricFrame.getElevation(...) would use a
I think this could be done in a backward compatible way without duplicating much code by having
DynamicTransform. Might be a moot point since I won’t be able to implement this by the end of May and the next release is a major one.
One complicating factor is that Orekit does not have a type that just combines position and velocity coordinates (
PVCoordinates includes acceleration). This could create confusion in instances like the following. If done as part of a major release we move the acceleration parts of
PVCoordinates to a new
PVACoordinates class and similarly with
PVCoordinates pv = ...; KinematicTransform kinematic = frame.getDynamicTransformT(other, date); // It is a bit unclear if the following transforms the acceleration of pv PVCoorinates newPV = kinematic.transformPVCoordinates(pv);
What do you think?