FFT benchmark

June 20, 2026 · View on GitHub

A benchmark for comparison of FFT algorithms performance. Supports 1D, 2D, and 3D transforms with float and double precision. Measures the performance of real/complex, in-place/out-of-place, forward/inverse FFT.

Supported libraries

LibraryVersionFloatDouble1D2D & 3DArbitrary sizesNotesRuntime dispatchInstallation
KFRn/aManual
FFTW3.3.10Vcpkg
Intel MKLn/aManual
Intel IPPn/aManual
Sleef3.9.0Power-of-2 sizes onlyVcpkg
PFFFT1.0.0multiples of SIMD size²Vcpkg
JUCE8.0.7Vcpkg
KissFFT131.2.0No real inverse; out-of-place onlyBundled
OTFFT11.5.0x86 only, real requires even sizesFetch
PocketFFT2023-09-25Vcpkg
vDSP (Accelerate)n/aApple onlyn/aSystem
libsamplerate0.2.2n/an/an/aSRC onlyVcpkg
soxr0.1.3n/an/an/aSRC onlyVcpkg
speexdsp1.2.1n/an/an/aSRC onlyVcpkg
r8brain-free-src7.1n/an/an/aSRC onlyFetch

Note

Not every library included here was designed with maximum performance as its primary goal. The selection is based on popularity and widespread use in real-world projects, rather than expected raw performance — so please keep that in mind when interpreting the results.

Building

Requirements

  • C++17 compiler (Clang 12.0+ recommended)
  • CMake 3.12 or newer
  • Python 3.5 or newer (for plotting)
    • matplotlib
    • numpy

Setup

The project supports two build configurations controlled by the OPEN option:

  • OPEN=ON (default) — compiles only open-source libraries (KFR, FFTW, PFFFT, JUCE, KissFFT, Sleef, libsamplerate, soxr, speexdsp, r8brain, PocketFFT, OTFFT). The resulting package is GPLv3-compatible.
  • OPEN=OFF — compiles only closed-source/proprietary libraries (Intel IPP, Intel MKL, and vDSP on Apple). Open-source libraries are excluded.

See .github/workflows/build-open.yml and .github/workflows/build-proprietary.yml for CI examples of each configuration.

To compile only a single library, pass -DSINGLE=<libname> (e.g. -DSINGLE=kfr). The resulting package will have the same license as that library.

Some libraries are available as packages in vcpkg and they will be found automatically on cmake configuration as vcpkg is bundled as submodule. Some libraries (e.g. KFR, Intel libraries) require manual installation, so you need to specify the paths to their CMake configs in CMAKE_PREFIX_PATH.

Warning

Each library has its own license. When multiple libraries are combined, the most restrictive license applies — GPL always wins.

Example:

C:/Program Files (x86)/Intel/oneAPI/ipp/2021.9.0/lib/cmake/ipp
C:/Program Files (x86)/Intel/oneAPI/mkl/2026.0/lib/cmake/mkl
kfr-install-dir/lib/cmake

Build

cmake -B build -DCMAKE_PREFIX_PATH="path1;path2;..."
cmake --build build

A separate executable is produced for each library found (e.g. fft_benchmark_kfr, fft_benchmark_ipp, etc.).

Note

All libraries are optional — if not found via CMake's find_package, they are simply disabled.

Usage

fft_benchmark_<library> [options] <size> [<size> ...]

Example:

fft_benchmark_kfr --save results.json 262144 512x512 64x64x64
fft_benchmark_kfr --save - 262144   # print JSON to stdout

Options

Note

Multithreading is disabled for fair comparison, as only a few libraries support it.

OptionDescription
SIZE1D FFT
SIZExSIZE2D FFT. Example: 64x32
SIZExSIZExSIZE3D FFT. Example: 64x32x16
--complex flagsy (complex tests), yn (all tests), n (real tests)
--inverse flagsy (IDFT tests), ny (DFT/IDFT tests), n (DFT tests)
--inplace flagsy (inplace tests), ny (all tests), n (out-of-place tests)
--save data.jsonSave results in JSON
--save -Print resulting JSON to stdout
--avx2-onlyEnable only AVX2 (supported in KFR, IPP, MKL)
--no-progressDisable verbose progress output
--no-bannerDisable banner

Plotting results

Use plot.py to generate comparison charts from the JSON output of multiple benchmark runs:

python plot.py results_kfr.json results_ipp.json results_fftw.json

This generates SVG plots for every combination of data type, transform type, direction, and buffer mode (e.g. float-complex-forward-inplace.svg).

JSON output format

Each benchmark run produces a JSON file with the following structure:

{
    "cpu": "...",
    "clock_MHz": 3600.0,
    "library": "...",
    "results": [
        {
            "size": 1024,
            "data": "float",
            "type": "complex",
            "direction": "forward",
            "buffer": "outofplace",
            "mflops": 12345.67,
            "best_time": 0.83,
            "median_time": 0.91
        }
    ]
}

For multidimensional transforms, size is an array (e.g. [512, 512]).

All trademarks, product names, and company names are the property of their respective owners and are used for identification purposes only.

Author

Dan Casarín, the author of KFR

License

MIT