Benchmark Overview
Last Updated: February 3, 2023These benchmarks compare single-thread decoding performance of Symphonia against FFmpeg. It’s always a good idea to run your own benchmarks with your specific workload!
RUSTFLAGS="-C target-cpu=native"- SIMD optimizations enabled
- Rust compiler version 1.67.0+
Performance Results
Intel Core i7-4790K (4C/8T @ 4.0 GHz)
| Codec | Symphonia (ms) | FFmpeg (ms) | Relative* |
|---|---|---|---|
| AAC-LC #1 (44 kHz, 260 kbps) | 148.8 ± 1.5 | 123.5 ± 1.1 | 1.21 |
| AAC-LC #2 (44 kHz, 260 kbps) | 131.0 ± 1.9 | 109.8 ± 1.0 | 1.19 |
| ADPCM IMA (44 kHz) | 905.0 ± 15.3 | 1095.6 ± 5.7 | 0.83 |
| ADPCM MS (44 kHz) | 1095.3 ± 7.6 | 972.3 ± 8.3 | 1.13 |
| ALAC (44 kHz, 16 bit) | 426.7 ± 3.4 | 586.7 ± 1.5 | 0.73 |
| ALAC (96 kHz, 32 bit) | 1363.6 ± 5.2 | 1724.8 ± 3.9 | 0.79 |
| FLAC (44 kHz, 16 bit) | 190.9 ± 1.0 | 267.8 ± 1.3 | 0.71 |
| FLAC (48 kHz, 24 bit) | 211.7 ± 0.8 | 295.5 ± 0.9 | 0.72 |
| FLAC (96 kHz, 24 bit) | 176.4 ± 1.4 | 239.5 ± 1.0 | 0.74 |
| MP1 (44 kHz, 192 kbps) | 91.9 ± 0.8 | 202.0 ± 1.8 | 0.45 |
| MP1 (44 kHz, 448 kbps) | 106.2 ± 0.9 | 222.8 ± 1.3 | 0.48 |
| MP2 (44 kHz, 128 kbps) | 207.1 ± 2.0 | 346.1 ± 5.0 | 0.60 |
| MP2 (44 kHz, 384 kbps) | 239.5 ± 2.7 | 396.4 ± 3.6 | 0.60 |
| MP3 (44 kHz, 128 kbps) | 262.2 ± 2.0 | 253.0 ± 1.0 | 1.04 |
| MP3 (44 kHz, 320 kbps) | 187.6 ± 1.5 | 222.9 ± 1.1 | 0.84 |
| Vorbis (44 kHz, ~256 kbps) | 317.6 ± 2.2 | 302.9 ± 2.5 | 1.05 |
Apple M1 Pro (8C Performance + 2C Efficiency @ 3.2 GHz)
| Codec | Symphonia (ms) | FFmpeg (ms) | Relative* |
|---|---|---|---|
| AAC-LC #1 (44 kHz, 260 kbps) | 127.4 ± 0.6 | 115.6 ± 0.7 | 1.10 |
| AAC-LC #2 (44 kHz, 260 kbps) | 112.7 ± 0.3 | 102.2 ± 0.5 | 1.10 |
| ADPCM IMA (44 kHz) | 1191.3 ± 1.6 | 789.4 ± 0.9 | 1.51 |
| ADPCM MS (44 kHz) | 724.5 ± 1.8 | 1235.5 ± 6.0 | 0.59 |
| ALAC (44 kHz, 16 bit) | 339.3 ± 2.6 | 420.6 ± 1.2 | 0.81 |
| ALAC (96 kHz, 32 bit) | 1079.5 ± 1.7 | 1403.2 ± 1.5 | 0.77 |
| FLAC (44 kHz, 16 bit) | 170.8 ± 0.9 | 267.7 ± 0.5 | 0.64 |
| FLAC (48 kHz, 24 bit) | 179.2 ± 0.4 | 349.6 ± 0.8 | 0.51 |
| FLAC (96 kHz, 24 bit) | 155.2 ± 0.5 | 274.4 ± 1.1 | 0.57 |
| MP1 (44 kHz, 192 kbps) | 72.2 ± 0.3 | 114.4 ± 0.7 | 0.63 |
| MP1 (44 kHz, 448 kbps) | 83.2 ± 0.4 | 130.5 ± 0.4 | 0.64 |
| MP2 (44 kHz, 128 kbps) | 144.8 ± 0.4 | 202.1 ± 0.5 | 0.72 |
| MP2 (44 kHz, 384 kbps) | 177.0 ± 0.3 | 230.8 ± 1.6 | 0.77 |
| MP3 (44 kHz, 128 kbps) | 204.3 ± 0.5 | 203.9 ± 0.6 | 1.00 |
| MP3 (44 kHz, 320 kbps) | 150.2 ± 0.3 | 186.5 ± 0.7 | 0.81 |
| Vorbis (44 kHz, ~256 kbps) | 307.9 ± 0.6 | 247.6 ± 0.6 | 1.24 |
Raspberry Pi 4B (4C Cortex-A72 @ 1.5 GHz)
| Codec | Symphonia (ms) | FFmpeg (ms) | Relative* |
|---|---|---|---|
| AAC-LC #1 (44 kHz, 260 kbps) | 566.6 ± 2.5 | 446.8 ± 2.6 | 1.27 |
| AAC-LC #2 (44 kHz, 260 kbps) | 502.8 ± 3.0 | 401.7 ± 2.9 | 1.25 |
| ADPCM IMA (44 kHz) | 3033.3 ± 16.9 | 2879.9 ± 5.8 | 1.05 |
| ADPCM MS (44 kHz) | 2536.5 ± 5.9 | 2655.5 ± 7.1 | 0.96 |
| ALAC (44 kHz, 16 bit) | 1227.2 ± 2.7 | 1512.9 ± 1.6 | 0.81 |
| ALAC (96 kHz, 32 bit) | 3900.4 ± 13.8 | 4456.7 ± 5.7 | 0.88 |
| FLAC (44 kHz, 16 bit) | 734.2 ± 2.6 | 704.2 ± 2.0 | 1.04 |
| FLAC (48 kHz, 24 bit) | 818.3 ± 2.3 | 855.8 ± 2.5 | 0.96 |
| FLAC (96 kHz, 24 bit) | 650.4 ± 1.8 | 677.0 ± 2.0 | 0.96 |
| MP1 (44 kHz, 192 kbps) | 428.2 ± 11.7 | 514.9 ± 3.5 | 0.83 |
| MP1 (44 kHz, 448 kbps) | 498.5 ± 6.5 | 574.1 ± 7.4 | 0.87 |
| MP2 (44 kHz, 128 kbps) | 796.8 ± 23.6 | 879.9 ± 3.9 | 0.91 |
| MP2 (44 kHz, 384 kbps) | 930.7 ± 6.6 | 1001.5 ± 19.0 | 0.93 |
| MP3 (44 kHz, 128 kbps) | 964.4 ± 8.1 | 899.5 ± 6.8 | 1.07 |
| MP3 (44 kHz, 320 kbps) | 693.3 ± 8.0 | 726.6 ± 3.8 | 0.95 |
| Vorbis (44 kHz, ~256 kbps) | 1209.9 ± 3.0 | 1075.5 ± 6.9 | 1.12 |
Performance Analysis
Codec Performance Summary
FLAC - Excellent Performance
FLAC - Excellent Performance
Symphonia’s FLAC decoder consistently outperforms FFmpeg across all platforms, with performance improvements ranging from 29% to 49% faster.The decoder is particularly efficient on Apple Silicon, where it achieves nearly 2x the performance of FFmpeg for 48kHz 24-bit files.
MPEG Audio (MP1/MP2) - Outstanding Performance
MPEG Audio (MP1/MP2) - Outstanding Performance
Symphonia’s MPEG Layer I and II decoders show exceptional performance, running 40-55% faster than FFmpeg on most platforms.These decoders benefit significantly from Rust’s optimization capabilities and modern CPU features.
MP3 - Competitive Performance
MP3 - Competitive Performance
MP3 decoding is highly competitive, matching or slightly exceeding FFmpeg’s performance across platforms.On Apple M1, Symphonia matches FFmpeg exactly for 128kbps files and is 19% faster for 320kbps files.
ALAC - Strong Performance
ALAC - Strong Performance
ALAC decoding shows consistent 19-23% performance improvements over FFmpeg across different sample rates and bit depths.
AAC - Room for Improvement
AAC - Room for Improvement
AAC-LC decoding is currently 10-27% slower than FFmpeg depending on the platform.This is an area for potential optimization. Contributions are welcome!
Platform Considerations
- x86-64 (Intel/AMD): Symphonia performs excellently on x86-64, with most codecs matching or exceeding FFmpeg
- Apple Silicon (M1/M2): Outstanding performance, especially for FLAC and MPEG audio codecs
- ARM (Raspberry Pi): Competitive performance even on resource-constrained devices
Performance varies significantly by codec and CPU architecture. The exact performance depends on:
- Codec features used in the encoding
- Rust compiler version (newer is generally better)
- CPU architecture and features
- SIMD optimization settings
SIMD Optimizations
At this time, SIMD optimizations are not enabled by default. Enabling SIMD support will pull in therustfft dependency.
Available SIMD Features
| Instruction Set | Feature Flag | Platform | Default |
|---|---|---|---|
| SSE | opt-simd-sse | x86/x86-64 | No |
| AVX | opt-simd-avx | x86-64 | No |
| Neon | opt-simd-neon | ARM/AArch64 | No |
Enabling SIMD
Enable all SIMD optimizations:Build Optimizations
For maximum performance, build Symphonia with target-specific optimizations:Profile-Guided Optimization (PGO)
For even better performance, consider using Profile-Guided Optimization:- Build with instrumentation
- Run with representative workload
- Rebuild with profiling data
Benchmark Limitations
Factors not fully covered:- Different encoding parameters exercise different code paths
- Compiler version significantly impacts performance
- Some files were used during decoder development and may be optimized for
- Single-threaded decoding only (FFmpeg can use multiple threads for some codecs)
Running Your Own Benchmarks
To benchmark Symphonia yourself:Contributing Performance Improvements
If you identify performance bottlenecks or have optimization ideas:- Profile the code to identify hotspots
- Run benchmarks before and after changes
- Test across multiple platforms if possible
- Submit a pull request with benchmark results