Mercurial > hg > svgui
changeset 1164:f2f43802718b 3.0-integration
More timings and cache hit counts
author | Chris Cannam |
---|---|
date | Thu, 10 Nov 2016 09:58:28 +0000 |
parents | ab169938832a |
children | c036560a7205 |
files | layer/Colour3DPlotRenderer.cpp layer/ScrollableImageCache.cpp layer/ScrollableMagRangeCache.cpp |
diffstat | 3 files changed, 24 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp Tue Nov 08 14:55:53 2016 +0000 +++ b/layer/Colour3DPlotRenderer.cpp Thu Nov 10 09:58:28 2016 +0000 @@ -289,6 +289,8 @@ Colour3DPlotRenderer::getColumn(int sx, int minbin, int nbins, bool usePeakCache) const { + Profiler profiler("Colour3DPlotRenderer::getColumn"); + // order: // get column -> scale -> normalise -> record extents -> // peak pick -> distribute/interpolate -> apply display gain @@ -737,6 +739,8 @@ RenderTimer::FastRender : RenderTimer::NoTimeout); + Profiler profiler("Colour3DPlotRenderer::renderDrawBuffer"); + int divisor = 1; const DenseThreeDimensionalModel *sourceModel = m_sources.source; if (usePeakCache) { @@ -977,7 +981,7 @@ } if (!pixelPeakColumn.empty()) { - + for (FFTModel::PeakSet::const_iterator pi = peakfreqs.begin(); pi != peakfreqs.end(); ++pi) {
--- a/layer/ScrollableImageCache.cpp Tue Nov 08 14:55:53 2016 +0000 +++ b/layer/ScrollableImageCache.cpp Thu Nov 10 09:58:28 2016 +0000 @@ -14,6 +14,8 @@ #include "ScrollableImageCache.h" +#include "base/HitCount.h" + #include <iostream> using namespace std; @@ -23,6 +25,8 @@ ScrollableImageCache::scrollTo(const LayerGeometryProvider *v, sv_frame_t newStartFrame) { + static HitCount count("ScrollableImageCache: scrolling"); + int dx = (v->getXForFrame(m_startFrame) - v->getXForFrame(newStartFrame)); @@ -33,12 +37,14 @@ if (m_startFrame == newStartFrame) { // haven't moved + count.hit(); return; } m_startFrame = newStartFrame; if (!isValid()) { + count.miss(); return; } @@ -46,14 +52,18 @@ if (dx == 0) { // haven't moved visibly (even though start frame may have changed) + count.hit(); return; } if (dx <= -w || dx >= w) { // scrolled entirely off invalidate(); + count.miss(); return; } + + count.partial(); // dx is in range, cache is scrollable
--- a/layer/ScrollableMagRangeCache.cpp Tue Nov 08 14:55:53 2016 +0000 +++ b/layer/ScrollableMagRangeCache.cpp Thu Nov 10 09:58:28 2016 +0000 @@ -14,6 +14,8 @@ #include "ScrollableMagRangeCache.h" +#include "base/HitCount.h" + #include <iostream> using namespace std; @@ -23,6 +25,8 @@ ScrollableMagRangeCache::scrollTo(const LayerGeometryProvider *v, sv_frame_t newStartFrame) { + static HitCount count("ScrollableMagRangeCache: scrolling"); + int dx = (v->getXForFrame(m_startFrame) - v->getXForFrame(newStartFrame)); @@ -33,6 +37,7 @@ if (m_startFrame == newStartFrame) { // haven't moved + count.hit(); return; } @@ -40,6 +45,7 @@ if (dx == 0) { // haven't moved visibly (even though start frame may have changed) + count.hit(); return; } @@ -48,8 +54,11 @@ if (dx <= -w || dx >= w) { // scrolled entirely off invalidate(); + count.miss(); return; } + + count.partial(); // dx is in range, cache is scrollable