changeset 1340:f5f83fb49852 3.0-integration

More cache hit counts; make debug output from colour 3d plot renderer (even though it is to SVDEBUG) appear only with explicit debug flag
author Chris Cannam
date Thu, 05 Jan 2017 14:30:49 +0000
parents df59bf0b4236
children 513e4d67d8df
files data/model/Dense3DModelPeakCache.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/Dense3DModelPeakCache.cpp	Thu Jan 05 11:10:38 2017 +0000
+++ b/data/model/Dense3DModelPeakCache.cpp	Thu Jan 05 14:30:49 2017 +0000
@@ -17,6 +17,8 @@
 
 #include "base/Profiler.h"
 
+#include "base/HitCount.h"
+
 Dense3DModelPeakCache::Dense3DModelPeakCache(const DenseThreeDimensionalModel *source,
 					     int columnsPerPeak) :
     m_source(source),
@@ -44,7 +46,6 @@
 Dense3DModelPeakCache::Column
 Dense3DModelPeakCache::getColumn(int column) const
 {
-    Profiler profiler("Dense3DModelPeakCache::getColumn");
     if (!m_source) return Column();
     if (!haveColumn(column)) fillColumn(column);
     return m_cache->getColumn(column);
@@ -79,7 +80,14 @@
 bool
 Dense3DModelPeakCache::haveColumn(int column) const
 {
-    return in_range_for(m_coverage, column) && m_coverage[column];
+    static HitCount count("Dense3DModelPeakCache");
+    if (in_range_for(m_coverage, column) && m_coverage[column]) {
+        count.hit();
+        return true;
+    } else {
+        count.miss();
+        return false;
+    }
 }
 
 void