diff 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
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Tue Apr 24 10:01:34 2018 +0100
+++ b/data/model/FFTModel.cpp	Tue Apr 24 14:13:51 2018 +0100
@@ -241,14 +241,20 @@
         
         sv_frame_t discard = range.first - m_savedData.range.first;
 
-        fvec acc(m_savedData.data.begin() + discard, m_savedData.data.end());
+        fvec data;
+        data.reserve(range.second - range.first);
 
-        fvec rest = getSourceDataUncached({ m_savedData.range.second, range.second });
+        data.insert(data.end(),
+                    m_savedData.data.begin() + discard,
+                    m_savedData.data.end());
 
-        acc.insert(acc.end(), rest.begin(), rest.end());
+        fvec rest = getSourceDataUncached
+            ({ m_savedData.range.second, range.second });
+
+        data.insert(data.end(), rest.begin(), rest.end());
         
-        m_savedData = { range, acc };
-        return acc;
+        m_savedData = { range, data };
+        return data;
 
     } else {
 
@@ -263,6 +269,8 @@
 FFTModel::fvec
 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const
 {
+    Profiler profiler("FFTModel::getSourceDataUncached");
+    
     decltype(range.first) pfx = 0;
     if (range.first < 0) {
         pfx = -range.first;