Skip to content
Commit 786e4fcc authored by Akarsh Simha's avatar Akarsh Simha
Browse files

Make EquatorialToHorizontal faster by a number of improvements

1. Cache trigonometric values for RA, Dec and RA0, Dec0

   Warning: This might negatively affect performance of
   updateCoords(), which is another MAJOR bottleneck in KStars

2. Avoid calling sincos() on HourAngle -- instead just compute it
   using CachingDms subtraction operator.

3. Avoid cos( AltRad ) computation. Instead use cos x = sqrt(1 -
   sin(x)^2)

The result is an improvement of EquatorialToHorizontal() average
run-time from ~ 567 ns to ~ 341 ns per call. Note: I would have
expected a more significant improvement, but it might be improved once
we remove profiling instrumentation from dms and CachingDms.
parent 69caa284
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment