Closed sdroege closed 4 years ago
For history I have a 22% improvement pending, but the main thing that will make a difference is speeding up the filter. That's considerably slower than the C implementation currently, and together with calc_gating_block()
(which is about as fast as the C version) it's the main thing taking time.
Actually the Rust implementation is as fast as the C one already when compiling with clang instead of gcc, sometimes marginally faster. With gcc it's sometimes marginally slower but otherwise equally fast. What is slower is the creation of the EburR128
instance in some modes, but in others it's faster... and that part doesn't really matter much in practice.
So while there might be some optimizations left worth doing, the port to Rust didn't cause any regressions in performance at least.
src/history.rs
could probably be faster by getting rid of some bounds checkssrc/filter.rs
and all code following it could probably be faster by first deinterleaving the input channels before doing any further processing. Note that this requires updating insrc/ebur128.rs
for theaudio_data
handling, and thatsrc/true_peak.rs
already works on deinterleaved data (by deinterleaving it first)EbuR128::calc_gating_block()
potentially has some unneeded bounds checks