Skip to content

Commit bd9a807

Browse files
(Perf improvement) Only copy needed input data into peak detector's filtered_y.
Elements after filtered_y[lag] are set to a value in a main loop, so filtered_y only needs to copy the first `lag` values from `data_in`, not the entire array.
1 parent c83a241 commit bd9a807

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlrunner/mldataprocessor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ MldpReturn_t filterPeaks(const float *data_in, const int in_size, float *data_ou
9898
float lead_in[lag];
9999

100100
memset(signals, 0, in_size * sizeof(float));
101-
memcpy(filtered_y, data_in, in_size * sizeof(float));
101+
memcpy(filtered_y, data_in, lag * sizeof(float));
102102
memcpy(lead_in, data_in, lag * sizeof(float));
103103

104104
float mean_lag, std_dev_lag;

0 commit comments

Comments
 (0)