summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-09-25 08:39:03 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-09-28 22:16:21 (GMT)
commit62b1e6acf87b087aa3a3871b8f8bfe7f25ff603b (patch)
tree166b1c2e6d02f5637035916f8061b2c15d5460d5
parentda8bcf7b52407bf8b1bbb35e303cb77399e723c0 (diff)
Profiling: Show caching information.
-rw-r--r--kstars/auxiliary/cachingdms.h2
-rw-r--r--kstars/skycomponents/deepstarcomponent.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/kstars/auxiliary/cachingdms.h b/kstars/auxiliary/cachingdms.h
index 82ba7a3..a95c4fb 100644
--- a/kstars/auxiliary/cachingdms.h
+++ b/kstars/auxiliary/cachingdms.h
@@ -204,7 +204,7 @@ private:
#ifdef COUNT_DMS_SINCOS_CALLS
public:
static unsigned long cachingdms_constructor_calls;
- static unsigned long cachingdms_delta; // difference of ( trig function calls ) - ( trig computations )
+ static long cachingdms_delta; // difference of ( trig function calls ) - ( trig computations )
#endif
};
diff --git a/kstars/skycomponents/deepstarcomponent.cpp b/kstars/skycomponents/deepstarcomponent.cpp
index a04ad2f..8d954fc 100644
--- a/kstars/skycomponents/deepstarcomponent.cpp
+++ b/kstars/skycomponents/deepstarcomponent.cpp
@@ -323,6 +323,8 @@ void DeepStarComponent::draw( SkyPainter *skyp ) {
trig_redundancy_here += dms::redundant_trig_function_calls;
qDebug() << "Spent " << dms::seconds_in_trig << " seconds doing " << trig_calls_here << " trigonometric function calls amounting to an average of " << 1000.0 * dms::seconds_in_trig/double( trig_calls_here ) << " ms per call";
qDebug() << "Redundancy of trig calls in this draw: " << double( trig_redundancy_here ) / double( trig_calls_here ) * 100. << "%";
+ qDebug() << "CachedDms constructor calls so far: " << CachingDms::cachingdms_constructor_calls;
+ qDebug() << "Caching has prevented " << CachingDms::cachingdms_delta << " redundant trig function calls";
#endif
#else
Q_UNUSED(skyp)