Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the `CMicrophonePitchTracker` C module into new `ZenFFT` and `ZenPTrack` Swift modules. When compiling the new modules with `-Ounchecked` performance is within 2% of the C version. Without `-Ounchecked` it has a ~15% overhead. With `-Ounchecked`: ```console $ hyperfine --warmup 5 -m 20 ./pitchbench-c ./pitchbench-swift Benchmark 1: ./pitchbench-c Time (mean ± σ): 392.8 ms ± 0.8 ms [User: 379.5 ms, System: 9.4 ms] Range (min … max): 391.8 ms … 394.9 ms 20 runs Benchmark 2: ./pitchbench-swift Time (mean ± σ): 401.5 ms ± 0.7 ms [User: 386.9 ms, System: 10.7 ms] Range (min … max): 400.6 ms … 402.8 ms 20 runs Summary './pitchbench-c' ran 1.02 ± 0.00 times faster than './pitchbench-swift' ``` Without `-Ounchecked`: ```console $ hyperfine --warmup 5 -m 20 ./pitchbench-c ./pitchbench-swift Benchmark 1: ./pitchbench-c Time (mean ± σ): 393.0 ms ± 1.4 ms [User: 380.3 ms, System: 8.7 ms] Range (min … max): 391.9 ms … 398.4 ms 20 runs Benchmark 2: ./pitchbench-swift Time (mean ± σ): 451.1 ms ± 1.0 ms [User: 436.0 ms, System: 11.0 ms] Range (min … max): 449.7 ms … 454.7 ms 20 runs Summary './pitchbench-c' ran 1.15 ± 0.00 times faster than './pitchbench-swift' ```
- Loading branch information