Reproducible latency and throughput comparison between Dora and ROS2 using identical workloads.
- Dora CLI installed (
cargo install --path binaries/cli) - Python Dora package:
pip install dora-rs numpyandpyarrow:pip install numpy pyarrow- ROS2 Humble (or later) with
rclpyandstd_msgs
Both frameworks run the same workload:
- Latency: 100 messages per payload size with 5ms sleep between sends
- Throughput: 100 messages per payload size sent back-to-back
- Payload sizes: 0B, 8B, 64B, 512B, 2KB, 4KB, 16KB, 40KB, 400KB, 4MB
- Timestamps:
time.perf_counter_ns()embedded in first 8 bytes of each payload - Metrics: avg, p50, p95, p99, p99.9, min, max latency; messages/sec throughput
Both sides use Python APIs to ensure a fair comparison of framework overhead (not language performance).
cd examples/ros2-comparison
./run_comparison.shThis runs both benchmarks sequentially and prints a comparison table.
BENCH_CSV=results/dora.csv dora run dataflow.yml --uvTerminal 1 (receiver):
BENCH_CSV=results/ros2.csv python3 ros2_receiver.pyTerminal 2 (sender):
python3 ros2_sender.pypython3 analyze.py results/dora.csv results/ros2.csvCSV files contain one row per (mode, payload_size):
latency,<bytes>,<label>,<n>,<avg_ns>,<p50_ns>,<p95_ns>,<p99_ns>,<p999_ns>,<min_ns>,<max_ns>
throughput,<bytes>,<label>,<n>,<msg_per_sec>,<elapsed_ns>,0,0,0,0,0
| File | Description |
|---|---|
dora_sender.py |
Dora benchmark sender node |
dora_receiver.py |
Dora benchmark receiver node |
dataflow.yml |
Dora dataflow definition |
ros2_sender.py |
ROS2 benchmark publisher |
ros2_receiver.py |
ROS2 benchmark subscriber |
run_comparison.sh |
Orchestration script |
analyze.py |
CSV comparison and reporting |