Mercurial > hg > svcore
changeset 1258:200c60de27ca 3.0-integration
More timings and cache hit counts
author | Chris Cannam |
---|---|
date | Thu, 10 Nov 2016 09:58:28 +0000 |
parents | 5236543343c3 |
children | a4554bf41367 |
files | data/fileio/WavFileReader.cpp data/model/FFTModel.cpp |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/data/fileio/WavFileReader.cpp Thu Nov 10 09:23:05 2016 +0000 +++ b/data/fileio/WavFileReader.cpp Thu Nov 10 09:58:28 2016 +0000 @@ -16,6 +16,7 @@ #include "WavFileReader.h" #include "base/HitCount.h" +#include "base/Profiler.h" #include <iostream> @@ -138,6 +139,8 @@ QMutexLocker locker(&m_mutex); + Profiler profiler("WavFileReader::getInterleavedFrames"); + if (!m_file || !m_channelCount) { return {}; }
--- a/data/model/FFTModel.cpp Thu Nov 10 09:23:05 2016 +0000 +++ b/data/model/FFTModel.cpp Thu Nov 10 09:58:28 2016 +0000 @@ -291,12 +291,12 @@ vector<complex<float>> FFTModel::getFFTColumn(int n) const { - // The small cache (i.e. the m_cached deque) is for peak-frequency - // spectrograms, where values from two consecutive columns are + // The small cache (i.e. the m_cached deque) is for cases where + // values are looked up individually, and for e.g. peak-frequency + // spectrograms where values from two consecutive columns are // needed at once. This cache gets essentially no hits when - // scrolling through a magnitude spectrogram but 95%+ hits with a - // peak-frequency spectrogram. Since it costs very little, it's - // well worth having. + // scrolling through a magnitude spectrogram, but 95%+ hits with a + // peak-frequency spectrogram. for (const auto &incache : m_cached) { if (incache.n == n) { inSmallCache.hit(); @@ -304,6 +304,8 @@ } } inSmallCache.miss(); + + Profiler profiler("FFTModel::getFFTColumn (cache miss)"); auto samples = getSourceSamples(n); m_windower.cut(samples.data());