Mercurial > hg > svcore
diff data/model/Dense3DModelPeakCache.cpp @ 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 | 9884efa1f88a |
children | 368449629a30 |
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