~mutlaqja/kstars-bleeding/+git/kstars-master:skypoint_optimization_attempts

Last commit made on 2016-09-25
Get this branch:
git clone -b skypoint_optimization_attempts https://git.launchpad.net/~mutlaqja/kstars-bleeding/+git/kstars-master

Branch merges

Branch information

Name:
skypoint_optimization_attempts
Repository:
lp:~mutlaqja/kstars-bleeding/+git/kstars-master

Recent commits

9f30554... by Akarsh Simha <email address hidden>

FIXME! dms::reduce() doesn't modify the dms, it returns a new one

Ideally, reduce() should've reduced in-place, and reduced() should
return a new dms, but this might need a lot of code changes. Well...

35df83a... by Akarsh Simha <email address hidden>

Some minor optimizations.

741a9ec... by Akarsh Simha <email address hidden>

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.

a706cc0... by Akarsh Simha <email address hidden>

Avoid resetting "catalog" coordinates if no proper motion was applied

04b6c84... by Akarsh Simha <email address hidden>

Make KSNumbers::obliquity() return CachingDms

Profiling did not reveal a significant advantage here mostly because
of the updateCoords() short-circuit in
StarObject::JITUpdate(). However, I presume that the impact will be
significant when slewing / zooming -- operations that are very hard to
profile, and time steps of > 1 minute, which we will have to
unfortunately address only later.

5cdef95... by Akarsh Simha <email address hidden>

Change LST and latitude to CachingDms -- this saves a lot of trig calls!

Test case:
==========

Simulation clock running at 1s per step, centered around USNO NOMAD
milky way artifact patch at the center of milky way, specifically on
Globular Cluster NGC 6569 at Zoom Factor of 32000. Using Horizontal
Coordinates. Projection = 3.

Results:
========

Before:
-------
For the USNO NOMAD catalog under these conditions,
DeepStarComponent::draw spent ~ 0.25s doing ~2233550 trigonometric
function calls per draw ( presumably without updateCoords() being
called -- we call updateCoords only if there's a time slew of more
than 1 solar minute; see StarObject::JITUpdate() )

After:
------

After the change, DSC::draw() spent only ~ 0.18s doing only ~1489260
trigonometric function calls.

Note: A call to sincos() is considered to be 2 trigonometric calls.

b2b5814... by Akarsh Simha <email address hidden>

Show global number of bad CachingDms uses

de6b0ff... by Akarsh Simha <email address hidden>

Add profiling code to catch bad uses of CachingDms

A bad use of CachingDms would be one where a CachingDms is created or
an angle is changed, but the cached sin/cos values are never made use
of.

8a35f26... by Akarsh Simha <email address hidden>

Profiling: Show caching information.

56751a7... by Akarsh Simha <email address hidden>

Tests for CachingDms

Test cases for CachingDms to check various operations.