roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.09k stars 213 forks source link

Create micro-benchmarks for audio codecs #753

Open gavv opened 4 months ago

gavv commented 4 months ago

We have two interfaces for audio codecs: IFrameEncoder and IFrameDecoder. Currently, they have just two implementations: PcmEncoder and PcmDecoder. Later we'll add more.

We want to add a benchmark that measures performance of encoder and decoder, as number of processed samples per second.

Codecs benchmarks should be able to iterate an list of available codecs and measure each one, like we're doing it in codecs tests here: test_frame_encoder_decoder.cpp.

We use Google Benchmark. To add a new benchmark, just create a new file bench_FOO.cpp in src/tests/MODULE_NAME (roc_audio in this case). Here are examples of existing micro-benchmarks: 1, 2. You can find details on building and running benchmarks here.