This example attempts to measure the raw performance of the Caryatid framework for simple pub-sub messages passed internally and via an external bus (RabbitMQ). It uses a multi-threaded publisher which can send simple typed messages of a configured length, and a subscriber which just counts messages and elapsed time and outputs the statistics when it gets a "stop" message.
$ cd examples/performance
$ cargo run --releaseNotice the --release flag to get realistic production performance. It makes a big difference!
You can configure the number of threads (actually Tokio tasks, which it will spread across actual process threads) and the message size in the configuration:
[module.publisher]
topic = "performance.test"
# Number of messages per thread
count = 1000000
# Number of threads
threads = 1
# Length of 'data' string
length = 10000By default the messages are routed internally - you can change this to external by changing the route:
[[message-router.route]]
pattern = "#"
bus = "external"