Mercurial > hg > svcore
comparison data/model/FFTModel.cpp @ 1457:0925b37a3ed1
Some messing around with profiling
author | Chris Cannam |
---|---|
date | Tue, 24 Apr 2018 14:13:51 +0100 |
parents | 48e9f538e6e9 |
children | 36b4872e894a |
comparison
equal
deleted
inserted
replaced
1456:904e031c9c76 | 1457:0925b37a3ed1 |
---|---|
239 | 239 |
240 inSourceCache.partial(); | 240 inSourceCache.partial(); |
241 | 241 |
242 sv_frame_t discard = range.first - m_savedData.range.first; | 242 sv_frame_t discard = range.first - m_savedData.range.first; |
243 | 243 |
244 fvec acc(m_savedData.data.begin() + discard, m_savedData.data.end()); | 244 fvec data; |
245 | 245 data.reserve(range.second - range.first); |
246 fvec rest = getSourceDataUncached({ m_savedData.range.second, range.second }); | 246 |
247 | 247 data.insert(data.end(), |
248 acc.insert(acc.end(), rest.begin(), rest.end()); | 248 m_savedData.data.begin() + discard, |
249 m_savedData.data.end()); | |
250 | |
251 fvec rest = getSourceDataUncached | |
252 ({ m_savedData.range.second, range.second }); | |
253 | |
254 data.insert(data.end(), rest.begin(), rest.end()); | |
249 | 255 |
250 m_savedData = { range, acc }; | 256 m_savedData = { range, data }; |
251 return acc; | 257 return data; |
252 | 258 |
253 } else { | 259 } else { |
254 | 260 |
255 inSourceCache.miss(); | 261 inSourceCache.miss(); |
256 | 262 |
261 } | 267 } |
262 | 268 |
263 FFTModel::fvec | 269 FFTModel::fvec |
264 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const | 270 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const |
265 { | 271 { |
272 Profiler profiler("FFTModel::getSourceDataUncached"); | |
273 | |
266 decltype(range.first) pfx = 0; | 274 decltype(range.first) pfx = 0; |
267 if (range.first < 0) { | 275 if (range.first < 0) { |
268 pfx = -range.first; | 276 pfx = -range.first; |
269 range = { 0, range.second }; | 277 range = { 0, range.second }; |
270 } | 278 } |