Skip to content

Commit

Permalink
Re-integrate and document the fan-out benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverlord committed Feb 24, 2024
1 parent 3c64a31 commit 94669d7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
find_package(benchmark QUIET)

# add_subdirectory(cluster)
# add_subdirectory(fan-out)
add_subdirectory(fan-out)
# add_subdirectory(routing-table)
# add_subdirectory(serialization)
7 changes: 7 additions & 0 deletions tests/benchmarks/fan-out/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_executable(broker-fan-out-benchmark
fan-out.cc
)
target_link_libraries(broker-fan-out-benchmark PRIVATE ${BROKER_LIBRARY})
target_include_directories(broker-fan-out-benchmark PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}")
9 changes: 9 additions & 0 deletions tests/benchmarks/fan-out/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The `broker-fan-out-benchmark` program is a standalone, self-contained tool to
measure the performance of a single publisher and multiple subscribers. All
Broker endpoints are created in a single process.

By default, the program has no output and simply runs until completion. The
intended use is to run the program with a tool like `time` to measure the time
it takes to send a certain number of messages to all subscribers.

To see all available options, run the program with the `--help` flag.
5 changes: 2 additions & 3 deletions tests/benchmarks/fan-out/fan-out.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ enum class term_color {

namespace {

constexpr uint64_t default_peer_count = 20;
constexpr uint64_t default_peer_count = 10;

constexpr uint64_t default_message_count = 10'000'000;
constexpr uint64_t default_message_count = 10'000;

constexpr uint64_t default_payload_size = 1'000;

Expand Down Expand Up @@ -187,7 +187,6 @@ void add_options(configuration& cfg, parameters& ps) {
"enables more console output");
cfg.add_option(&ps.naive_publish, "naive-publish",
"publish data via endpoint::publish instead of publish_all");
;
}

struct generator {
Expand Down

0 comments on commit 94669d7

Please sign in to comment.