AbstractCelestialBody.InertiallyOriented.getTransform(...) syncronizes on FramesFactory.class
Hi,
Great progress on multi-threading recently!
In my test cases I found some synchronization that is not necessary. The line:
final Transform t = definingFrame.getTransformTo(FramesFactory.getEME2000(), date);
from AbstractCelestialBody.InertiallyOriented.getTransform(...) implies syncronization on FramesFactory.class. This blocks when multiple propagation threads are running that include third body effects. An easy solution is to cache a reference to J2000 in AbstractCelestialBody so it is not looked up every time. I've attached a patch that implements this. This should be faster in the single thread case as well. With this change in my multi-threaded test case I noticed cpu utilization jump from ~30% to ~80%.
A possible downside is that the J2000 frame is created before it is needed, but it is a cheap frame to create.
(from redmine: issue id 116, created on 2012-09-21, closed on 2012-09-21)
- Uploads: