Micro Benchmarks
We have micro benchmarks for various components such as storage, stream and batch executors.
Running Micro Benchmarks
You can run them by specifying their name.
For instance to run json_parser micro benchmark:
cargo bench json_parser
Generating Flamegraph for Micro Benchmarks
Note: Flamegraph generation depends on
perf. You will need a linux box to run it.
-
Install
cargo-flamegraphcargo install flamegraph -
Install
perf. If on ubuntu:sudo apt install linux-toolsIf using EC2, you may need this instead:
sudo apt install linux-tools-awsOn an EC2 instance you may also need to set
paranoidlevel to 1, to give the profiler necessary permissions.sudo sh -c "echo 1 >/proc/sys/kernel/perf_event_paranoid" -
Run flamegraph + benchmark (change
json_parserto whichever benchmark you want to run.)cargo flamegraph --bench json_parser -- --benchWithin a benchmark, there are also typically multiple benchmark groups. For instance, within the
json_parserbench, there’sjson_parser,debezium_json_parser_(create/read/update/delete)To filter you can just append a regex. For instance to only benchjson_parser:cargo flamegraph --bench json_parser -- --bench ^json_parserYou can take a look at Criterion Docs for more information.