Commit 4dce683
authored
perf: speed up FLAC decode with buffer_read_into (#53)
Decode FLAC blobs via the low-level `sf.SoundFile.buffer_read_into` into a
pre-sized array instead of the `sf.read` convenience wrapper. This avoids
per-call allocation/dispatch overhead and is ~1.3x faster for the many
small blobs typical of reading waveform tables row-by-row.
Add a `test_benchmark_decode` mirroring the existing encode benchmark to
keep the decode path measurable and guard against regressions.1 parent efb9dd9 commit 4dce683
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments