4 |
This is a benchmark for comparison between a integer math, table lookup |
This is a benchmark for comparison between a integer math, table lookup |
5 |
and numeric sine wave harmonics solution. |
and numeric sine wave harmonics solution. |
6 |
|
|
7 |
Copyright (C) 2005 - 2016 Christian Schoenebeck <cuse@users.sf.net> |
Copyright (C) 2005 - 2017 Christian Schoenebeck <cuse@users.sf.net> |
8 |
*/ |
*/ |
9 |
|
|
10 |
#include <math.h> |
#include <math.h> |
84 |
clock_t start_time = clock(); |
clock_t start_time = clock(); |
85 |
|
|
86 |
for (int run = 0; run < RUNS; run++) { |
for (int run = 0; run < RUNS; run++) { |
87 |
pIntLFO->update(127); // pro forma |
pIntLFO->updateByMIDICtrlValue(127); // pro forma |
88 |
for (int i = 0; i < steps; ++i) { |
for (int i = 0; i < steps; ++i) { |
89 |
pDestinationBuffer[i] = pIntLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
pDestinationBuffer[i] = pIntLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
90 |
} |
} |
108 |
clock_t start_time = clock(); |
clock_t start_time = clock(); |
109 |
|
|
110 |
for (int run = 0; run < RUNS; run++) { |
for (int run = 0; run < RUNS; run++) { |
111 |
pIntAbsLFO->update(0); // pro forma |
pIntAbsLFO->updateByMIDICtrlValue(0); // pro forma |
112 |
for (int i = 0; i < steps; ++i) { |
for (int i = 0; i < steps; ++i) { |
113 |
pDestinationBuffer[i] = pIntAbsLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
pDestinationBuffer[i] = pIntAbsLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
114 |
} |
} |
202 |
clock_t start_time = clock(); |
clock_t start_time = clock(); |
203 |
|
|
204 |
for (int run = 0; run < RUNS; run++) { |
for (int run = 0; run < RUNS; run++) { |
205 |
pDiHarmonicLFO->update(127); // pro forma |
pDiHarmonicLFO->updateByMIDICtrlValue(127); // pro forma |
206 |
for (int i = 0; i < steps; ++i) { |
for (int i = 0; i < steps; ++i) { |
207 |
pDestinationBuffer[i] = pDiHarmonicLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
pDestinationBuffer[i] = pDiHarmonicLFO->render() * pAmp[i]; // * pAmp[i] just to simulate some memory load |
208 |
} |
} |