Mercurial > hg > svcore
comparison data/model/FFTModel.cpp @ 1257:5236543343c3 3.0-integration
A note on cache hit findings
author | Chris Cannam |
---|---|
date | Thu, 10 Nov 2016 09:23:05 +0000 |
parents | d8d6d01505ed |
children | 200c60de27ca |
comparison
equal
deleted
inserted
replaced
1256:d8d6d01505ed | 1257:5236543343c3 |
---|---|
289 } | 289 } |
290 | 290 |
291 vector<complex<float>> | 291 vector<complex<float>> |
292 FFTModel::getFFTColumn(int n) const | 292 FFTModel::getFFTColumn(int n) const |
293 { | 293 { |
294 for (auto &incache : m_cached) { | 294 // The small cache (i.e. the m_cached deque) is for peak-frequency |
295 // spectrograms, where values from two consecutive columns are | |
296 // needed at once. This cache gets essentially no hits when | |
297 // scrolling through a magnitude spectrogram but 95%+ hits with a | |
298 // peak-frequency spectrogram. Since it costs very little, it's | |
299 // well worth having. | |
300 for (const auto &incache : m_cached) { | |
295 if (incache.n == n) { | 301 if (incache.n == n) { |
296 inSmallCache.hit(); | 302 inSmallCache.hit(); |
297 return incache.col; | 303 return incache.col; |
298 } | 304 } |
299 } | 305 } |