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 FEC codecs #754

Open gavv opened 4 months ago

gavv commented 4 months ago

We have two classes fec::BlockReader and fec::BlockWriter that implement generation and processing of FEC packets. Internally they use fec::IBlockDecoder and fec::IBlockEncoder, which define FEC-scheme-specific codec, e.g. Reed Solomon or LDPC-Staircase.

We want to add a benchmark that measures performance of BlockReader and BlockWriter, as number of processed packets per second.

FEC benchmarks should be able to iterate an list of available codecs and measure each one, like we're doing it in FEC tests here: test_block_writer_reader.cpp. That file also can serve as an example how to use BlockReader and BlockWriter.

We need a few benchmarks for different FEC block sizes (defined by two parameters: number of source packets per block and number of repair packets per block), and different packet loss ratios (relevant only to BlockReader - e.g. lose every 3rd packet, every 10th packet, etc).

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.