Benchmarks: the matched filter
Compare processors and output modes with selectable hardware and linear or logarithmic axes.
Time per data/template pair, including the product, inverse transform and peak scan. Results cover the hosts and sizes listed below. Shared CI timings vary with runner load.
Cost of one (data, template) correlation with peak-only output. Lower is better.
FFTW and MKL time a batched, single-precision inverse FFT on one thread. matchedfilter includes the product, inverse transform and peak scan. These are different workloads; the reference FFT is one part of a complete matched filter.
NumPy supplies the float64 correctness reference. Timing comparisons appear only where FFTW or MKL was available.
Automatic CPU selection is shown once per host. AVX2 is shown separately when it differs; equivalent feature variants are omitted. Correctness CI still tests every compiled target.
What was tested
| Workload | 2 data segments x 16 templates = 32 pairs, 4 data segments x 32 templates = 128 pairs, 8 data segments x 64 templates = 512 pairs, 16 data segments x 128 templates = 2048 pairs, 32 data segments x 256 templates = 8192 pairs, 64 data segments x 512 templates = 32768 pairs, single-threaded, complex64 throughout, peaks searched over the middle 60% of lags. |
|---|---|
| Batch shape | Batching can reuse inputs across pairs. Compare timings at the same shape; the benchmark reduces batches at large lengths to bound memory use. |
| References | FFTW and MKL time the inverse FFT only, in single precision on one thread. matchedfilter also performs the product and peak scan. |
| runner | os | arch | back end | MF_ISA | python |
|---|---|---|---|---|---|
| Haswell (2x Xeon E5-2698 v3) | Linux | x86_64 | AVX2 | auto | 3.11.0 |
| dev1 (Ryzen 9 5950X) | Linux | x86_64 | AVX2 | auto | 3.13.6 |
| linux-arm64 | Linux | aarch64 | NEON_BF16 | auto | 3.12.14 |
| linux-x86_64 | Linux | x86_64 | AVX2 | auto | 3.12.14 |
| macos-arm64 | Darwin | arm64 | NEON | auto | 3.12.10 |
All numbers (71 rows, representative targets)
| runner | n | shape | us/pair | fftw us | mkl us | vs fftw | vs mkl | matches numpy |
|---|---|---|---|---|---|---|---|---|
| Haswell (2x Xeon E5-2698 v3) | 64 | 64x512 | 0.097 | 0.2 | 0.2 | 2.2x | 1.9x | yes |
| Haswell (2x Xeon E5-2698 v3) | 128 | 64x512 | 0.208 | 0.5 | 0.7 | 2.5x | 3.2x | yes |
| Haswell (2x Xeon E5-2698 v3) | 256 | 64x512 | 0.432 | 1.2 | 1.6 | 2.8x | 3.6x | yes |
| Haswell (2x Xeon E5-2698 v3) | 512 | 64x512 | 1.312 | 2.3 | 3.2 | 1.8x | 2.4x | yes |
| Haswell (2x Xeon E5-2698 v3) | 1024 | 64x512 | 2.269 | 5.2 | 6.8 | 2.3x | 3.0x | yes |
| Haswell (2x Xeon E5-2698 v3) | 2048 | 64x512 | 6.938 | 13.5 | 13.8 | 1.9x | 2.0x | yes |
| Haswell (2x Xeon E5-2698 v3) | 4096 | 64x512 | 14.895 | 25.4 | 28.6 | 1.7x | 1.9x | yes |
| Haswell (2x Xeon E5-2698 v3) | 8192 | 64x512 | 31.769 | 61.5 | 66.2 | 1.9x | 2.1x | yes |
| Haswell (2x Xeon E5-2698 v3) | 16384 | 64x512 | 70.124 | 131.7 | 144.6 | 1.9x | 2.1x | yes |
| Haswell (2x Xeon E5-2698 v3) | 32768 | 64x512 | 171.920 | 344.8 | 353.3 | 2.0x | 2.1x | yes |
| Haswell (2x Xeon E5-2698 v3) | 65536 | 32x256 | 399.454 | 712.3 | 845.9 | 1.8x | 2.1x | yes |
| dev1 (Ryzen 9 5950X) | 64 | 64x512 | 0.033 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 128 | 64x512 | 0.059 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 256 | 64x512 | 0.136 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 512 | 64x512 | 0.345 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 1024 | 64x512 | 0.827 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 2048 | 64x512 | 2.022 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 4096 | 64x512 | 4.332 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 8192 | 64x512 | 10.249 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 16384 | 64x512 | 18.614 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 32768 | 64x512 | 42.067 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 65536 | 32x256 | 88.611 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 131072 | 16x128 | 206.942 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 262144 | 8x64 | 454.511 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 524288 | 4x32 | 1047.939 | - | - | - | - | yes |
| dev1 (Ryzen 9 5950X) | 1048576 | 2x16 | 2255.628 | - | - | - | - | yes |
| linux-arm64 | 64 | 64x512 | 0.105 | 0.2 | - | 2.4x | - | yes |
| linux-arm64 | 128 | 64x512 | 0.211 | 0.6 | - | 2.7x | - | yes |
| linux-arm64 | 256 | 64x512 | 0.742 | 1.4 | - | 1.8x | - | yes |
| linux-arm64 | 512 | 64x512 | 1.513 | 3.2 | - | 2.1x | - | yes |
| linux-arm64 | 1024 | 64x512 | 3.258 | 6.8 | - | 2.1x | - | yes |
| linux-arm64 | 2048 | 64x512 | 7.288 | 15.4 | - | 2.1x | - | yes |
| linux-arm64 | 4096 | 64x512 | 15.088 | 34.1 | - | 2.3x | - | yes |
| linux-arm64 | 8192 | 64x512 | 32.616 | 76.3 | - | 2.3x | - | yes |
| linux-arm64 | 16384 | 64x512 | 66.823 | 169.6 | - | 2.5x | - | yes |
| linux-arm64 | 32768 | 64x512 | 141.060 | 366.7 | - | 2.6x | - | yes |
| linux-arm64 | 65536 | 32x256 | 295.786 | 804.2 | - | 2.7x | - | yes |
| linux-arm64 | 131072 | 16x128 | 680.590 | 1677.6 | - | 2.5x | - | yes |
| linux-arm64 | 262144 | 8x64 | 1499.828 | 3698.8 | - | 2.5x | - | yes |
| linux-arm64 | 524288 | 4x32 | 3366.098 | 9347.2 | - | 2.8x | - | yes |
| linux-arm64 | 1048576 | 2x16 | 7253.280 | 19698.9 | - | 2.7x | - | yes |
| linux-x86_64 | 64 | 64x512 | 0.051 | 0.1 | 0.1 | 1.4x | 1.8x | yes |
| linux-x86_64 | 128 | 64x512 | 0.087 | 0.2 | 0.2 | 1.8x | 2.8x | yes |
| linux-x86_64 | 256 | 64x512 | 0.217 | 0.3 | 0.5 | 1.5x | 2.4x | yes |
| linux-x86_64 | 512 | 64x512 | 0.538 | 1.1 | 1.4 | 2.1x | 2.7x | yes |
| linux-x86_64 | 1024 | 64x512 | 1.181 | 2.3 | 3.3 | 1.9x | 2.8x | yes |
| linux-x86_64 | 2048 | 64x512 | 3.075 | 5.6 | 6.9 | 1.8x | 2.3x | yes |
| linux-x86_64 | 4096 | 64x512 | 6.767 | 10.8 | 15.1 | 1.6x | 2.2x | yes |
| linux-x86_64 | 8192 | 64x512 | 14.287 | 25.3 | 35.4 | 1.8x | 2.5x | yes |
| linux-x86_64 | 16384 | 64x512 | 27.819 | 51.0 | 74.5 | 1.8x | 2.7x | yes |
| linux-x86_64 | 32768 | 64x512 | 62.825 | 126.5 | 165.0 | 2.0x | 2.6x | yes |
| linux-x86_64 | 65536 | 32x256 | 141.009 | 300.6 | 378.1 | 2.1x | 2.7x | yes |
| linux-x86_64 | 131072 | 16x128 | 331.623 | 580.6 | 2014.8 | 1.8x | 6.1x | yes |
| linux-x86_64 | 262144 | 8x64 | 1079.984 | 1331.4 | 5819.7 | 1.2x | 5.4x | yes |
| linux-x86_64 | 524288 | 4x32 | 1565.332 | 4992.1 | 2857.2 | 3.2x | 1.8x | yes |
| linux-x86_64 | 1048576 | 2x16 | 3466.670 | 10530.4 | 6290.7 | 3.0x | 1.8x | yes |
| macos-arm64 | 64 | 64x512 | 0.045 | 0.1 | - | 2.3x | - | yes |
| macos-arm64 | 128 | 64x512 | 0.118 | 0.3 | - | 2.4x | - | yes |
| macos-arm64 | 256 | 64x512 | 0.410 | 0.6 | - | 1.5x | - | yes |
| macos-arm64 | 512 | 64x512 | 0.847 | 1.3 | - | 1.6x | - | yes |
| macos-arm64 | 1024 | 64x512 | 1.678 | 3.3 | - | 2.0x | - | yes |
| macos-arm64 | 2048 | 64x512 | 4.330 | 10.4 | - | 2.4x | - | yes |
| macos-arm64 | 4096 | 64x512 | 8.289 | 14.9 | - | 1.8x | - | yes |
| macos-arm64 | 8192 | 64x512 | 18.718 | 39.5 | - | 2.1x | - | yes |
| macos-arm64 | 16384 | 64x512 | 43.823 | 128.7 | - | 2.9x | - | yes |
| macos-arm64 | 32768 | 64x512 | 90.964 | 359.1 | - | 3.9x | - | yes |
| macos-arm64 | 65536 | 32x256 | 193.217 | 651.6 | - | 3.4x | - | yes |
| macos-arm64 | 131072 | 16x128 | 490.300 | 1692.8 | - | 3.5x | - | yes |
| macos-arm64 | 262144 | 8x64 | 1152.741 | 2962.9 | - | 2.6x | - | yes |
| macos-arm64 | 524288 | 4x32 | 2034.773 | 6478.0 | - | 3.2x | - | yes |
| macos-arm64 | 1048576 | 2x16 | 4316.342 | 15274.9 | - | 3.5x | - | yes |