Back To Schedule

Building an Optimized DSP Framework in Modern C++

00:00 - 00:00 | Friday 31st October 2025 |
Advanced

The introduction of C++23 and upcoming C++26 features have significantly expanded the potential for building expressive, manageable embedded domain-specific languages (EDSLs) that compile efficiently into optimized lower-level representations. Features like enhanced constexpr and consteval execution enable a single descriptive representation of DSP algorithms to generate multiple optimized versions tailored to specific compile-time contexts.

Inspired by successful libraries such as Halide and Eigen, we will look at an experimental C++ library developed to explore clean separation between algorithm description, data structures, and execution strategies. It generalizes inner-loop optimizations vectorized across two dimensions, enabling consistent application of advanced optimization techniques across diverse DSP algorithms. The library provides us a collection of design patterns that we can use to formulate how a contemporary C++23/26 audio graph can be built.

This talk will explore practical techniques for implementing these design patterns in modern C++, demonstrating how they collectively form a robust framework for defining and executing efficient DSP algorithms:

  • Zero-cost Compile-time / Runtime Variant Values: Balancing compile-time-constant and runtime-variant values and complex data structures without incurring memory or performance penalties.
  • Cache-optimized Data Structures: Designing data structures that minimize cache misses while remaining developer-friendly.
  • Expression Templates: Using C++'s template metaprogramming to defer computation, enabling optimized evaluation and graph transformations.
  • Loop and Data Optimizations: Techniques for loop-invariant value hoisting, re-blocking, and linearization to improve memory and execution efficiency.
  • Finite Difference Optimization: Automated optimizations for polynomials, trigonometric functions, and interpolation routines to minimize runtime computation.
  • Unified Parallelism Models: Integrating voice-parallel and time-parallel computations within a single descriptive graph representation.
  • Compile-time Graph Transformations: Leveraging constexpr to construct and optimize directed graphs representing DSP signal flows, including handling feedback loops and delays.
  • Benchmarking Execution Strategies: Describing, benchmarking, and comparing graph execution strategies (time-parallel, voice-parallel, block-based), enabling parametric, empirical optimization decisions.
  • Empirical Validation: Investigating whether and how these techniques improve DSP performance in realistic scenarios, with comparisons against established commercial and OS audio engines.

By applying these strategies, we demonstrate how a single algorithmic representation can flexibly handle multiple DSP use-cases—from polynomial interpolation and envelope generation to buffer read/write operations—significantly reducing redundant code and enabling focused optimization.

Furthermore, separating algorithm logic from execution strategies allows parameterizing benchmarks and optimizations based on CPU architecture and usage patterns, preserving algorithm clarity without embedding machine-specific details.

These strategies will be presented individually so they can be applied immediately in existing audio code-bases, while also shown within a unified framework context to highlight potential improvements in code clarity, performance, maintainability, testing, and benchmarking. Topics will be accessible for moderate-to-advanced C++ programmers, and anyone interested in exploring cutting-edge practices in modern audio DSP programming.

Attendees will gain actionable insights, directly applicable techniques, and inspiration for advancing audio DSP code performance and clarity with modern C++.

Scott Carver

Scott Carver is a sound artist, composer, and software developer, specializing in synthesis, specialization, and control systems for music performances and installations, in their own music work and in collaboration with artists Christopher Kulenduran Thomas & Annika Kuhlmann, Lauryn Youden, and Nicolas Varchausky. They are concerned with the power of sound to restructure space and the body, and provide a landscape for emotional catharsis and communal, unstructured perception.
They have been a professional C++ programmer for almost 20 years, working at Adobe Systems, Native Instruments, on open-source creative software and as an engineer-collaborator on numerous large-scale art installations and performances.

VolumetricCondensed