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:
co-authored by
Claude Opus 5
parent
dd04a61e22
commit
c1758637df
+12
-1
@@ -11,6 +11,8 @@
|
||||
# Android toolchain; runs IosGoldenExport in ../app)
|
||||
# make core-test build the C++ core and compare it with the reference audio
|
||||
# (TYPES="FILTER EQ10" limits it to some devices)
|
||||
# make bench print what the insert-FX chain and each effect cost (SECONDS=1
|
||||
# for a quick look); asserts nothing, so it is not part of check
|
||||
# make au-test macOS check of the AUv3 wrapper: every effect through AVAudioEngine
|
||||
# must match the core, plus parameters, presets and saved state
|
||||
# make project generate app/Sizzle.xcodeproj (components + XcodeGen)
|
||||
@@ -98,6 +100,15 @@ build/core/oneshot_test: $(CORE_SRC) $(CORE_HDR) ../core/tests/oneshot_test.cpp
|
||||
mkdir -p build/core
|
||||
$(CXX) $(CXXFLAGS) -o $@ $(CORE_SRC) ../core/tests/oneshot_test.cpp
|
||||
|
||||
build/core/bench: $(CORE_SRC) $(CORE_HDR) ../core/tests/bench.cpp
|
||||
mkdir -p build/core
|
||||
$(CXX) $(CXXFLAGS) -o $@ $(CORE_SRC) ../core/tests/bench.cpp
|
||||
|
||||
# Not part of core-test: it asserts nothing, it just prints what the DSP costs, and
|
||||
# the numbers only mean something on a quiet machine. SECONDS=1 for a quick look.
|
||||
bench: build/core/bench
|
||||
build/core/bench $(SECONDS)
|
||||
|
||||
build/core/midi_test: ../core/include/sizzle/Midi.hpp ../core/tests/midi_test.cpp
|
||||
mkdir -p build/core
|
||||
$(CXX) $(CXXFLAGS) -o $@ ../core/tests/midi_test.cpp
|
||||
@@ -224,4 +235,4 @@ $(SPIKE_IPA): $(SPIKE_PROJ)/project.pbxproj $(SPIKE_SRC)
|
||||
clean:
|
||||
rm -rf build dist
|
||||
|
||||
.PHONY: help golden core-test zip-test au-test project ipa bump-major bump-minor bump-patch bump spike-ipa clean
|
||||
.PHONY: help golden core-test bench zip-test au-test project ipa bump-major bump-minor bump-patch bump spike-ipa clean
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user