Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fourier-transform to benchmarks #3

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bench/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const FFT = require('../');
const external = {
jensnockert: require('fft'),
dspjs: require('dsp.js'),
drom: require('fourier')
drom: require('fourier'),
fourierTransform: require('fourier-transform')
};
const benchmark = require('benchmark');

Expand Down Expand Up @@ -75,13 +76,23 @@ function addDrom(suite, size) {
});
}

function addFourierTransform(suite, size) {
const forward = external.fourierTransform;

const input = createInput(size);
suite.add('fourier-transform', () => {
forward(input);
});
}

function transform(size) {
const suite = new benchmark.Suite();

addSelf(suite, size);
addJensNockert(suite, size);
addDSPJS(suite, size);
addDrom(suite, size);
addFourierTransform(suite, size);

return suite;
}
Expand Down
3 changes: 2 additions & 1 deletion bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"benchmark": "^2.1.3",
"dsp.js": "github:corbanbrook/dsp.js",
"fft": "^0.2.1",
"fourier": "^0.2.1"
"fourier": "^0.2.1",
"fourier-transform": "^1.0.2"
}
}