WebAudio FFT Performance Test
WebAudio FFT Performance Test
To have a simple repeatable test for looking at performance of JS FFT implementations run realtime within WebAudio using ScriptProcessorNode
now, and AudioWorker
node (when that's added) to compare and contrast against native implementation.
This fell out of the WebAudio Spec discussion
Runs simple FFT passes over random data using either dsp.js, jsfft or fft-asm.js. (Please fork and add more)
The FFT size is settable, and so is the length of time the data is collected. The chunkSize for the ScriptProcessorNode
is set to the same as FFT size.
The data collected is DOMHighResolutionTimeStamp at the following moments :
ScriptProcessorNode
: onAudioProcessStart
onFFTStart
onFFTEnd
ScriptProcessorNode
: onAudioProcessEnd
Using this data, the current graph plots :
ScriptProcessorNode
callbacks : (onAudioProcessStart[index]-onAudioProcessEnd[index-1])
- labelled as Callback (msec)
perf.onFFTEnd[index]-perf.onFFTStart[index]
- labelled as FFTTime (msec)
MIT