bench: measure what the insert-FX chain costs, and drop the block-rate idea

`make -C ios bench` renders four channels of synth with 0/1/2/4 effects each,
times every effect on its own, and compares a ten-biquad cascade three ways. It
asserts nothing, so it stays out of core-test; no shipped code changes (the file
is under core/tests, which neither app compiles).

What it says, on an M4 at -O2. Per-sample virtual dispatch — listed in the
handover as a thing to fix — costs 0.11 ns of 9.13 ns per sample, about 1%: the
indirect branch is predicted and amortises over the effect's own work. The
obvious block restructuring is a 162% regression, because running band-at-a-time
over a block sends the running value through memory ten times per sample instead
of keeping it in a register across the cascade. So that idea is recorded as
measured and closed, rather than left as an invitation.

Where the cost actually is: Ambience, 52% of all eight effects together
(65.9 ns/sample, 3.5x Tape Delay). A full chain is ~77% of render time, and
three-quarters of that is Ambience. Not urgent — four channels of four effects
still render at 42x real time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-18 21:01:29 +01:00
co-authored by Claude Opus 5
parent ba98ec56f4
commit b3bae931b1
4 changed files with 317 additions and 6 deletions
+1
View File
@@ -11,6 +11,7 @@ Makefile (`make -C ios help`).
| `../core/include/sizzle/DeviceSpecs.gen.hpp` | Every device's parameters, generated from `ToolboxType` (Kotlin) |
| `../core/tests/golden_test.cpp` | Compares the core with audio the Kotlin code renders |
| `../core/tests/voices/` | The `TestVoice` wrappers `golden_test` drives the instruments through. Under `tests/`, not `src/`, so neither app compiles them |
| `../core/tests/bench.cpp` | `make bench`: what the FX chain and each effect cost. Asserts nothing, so it is not part of `core-test` |
| `app/components.txt` | The plugin list (AU type, subtype, device, name) |
| `app/FX/` | The plugin extension: `SizzleDeviceAU` (shared: parameters, presets, state), `SizzleEffectAU` (aufx), `SizzleInstrumentAU` (aumu), `SizzleFXViewController` (factory + editor). The app compiles the same classes to host them itself |
| `app/Host/SizzleSession*` | The bridge to the C++ song + engine (audio output, song lock, live-note queue); one category per screen |