@cryptotaxi247 / netdata-1 / commits / 265f5413c

Remove temporary allocations when preprocessing a samples buffer (#14208)

* Remove allocations when smoothing samples buffer The number of dims per sample is always 1, ie. we are training and predicting only individual dimensions. * Do not try to stop anomaly detection threads twice. A separate function call has been added to stop anomaly detection threads. This commit removes the left over function calls that were made internally when a host was being created/destroyed. * Move samples instead of copying.

vkalintiris committed Jan 12, 2023 at 10:42 UTC 265f5413c4aa026ee9097239ad474073c5a1d087
1 file changed +1 -1
ml/SamplesBuffer.cc
+1 -1
@@ -139,7 +139,7 @@ void SamplesBuffer::preprocess(std::vector<DSample> &Samples) {
139 const Sample PS = getPreprocessedSample(Idx);
140 PS.initDSample(DS);
141
142 - Samples.push_back(DS);
142 + Samples.push_back(std::move(DS));
143 }
144 }
145