-
Notifications
You must be signed in to change notification settings - Fork 198
[benchmark] pubsub benchmark for all 3 layers. #2440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
|
||
| #include <benchmark/benchmark.h> | ||
|
|
||
| #include <atomic> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'benchmark/benchmark.h' file not found [clang-diagnostic-error]
<benchmark/benchmark.h>
^| enum class TransportLayer : int | ||
| { | ||
| Shm = 0, | ||
| Udp = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'TransportLayer' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
um class TransportLayer : int
^| // Generate (payload_size, transport_layer) argument tuples. | ||
| static void TransportAndSizeArgs(benchmark::internal::Benchmark* b) | ||
| { | ||
| for (int layer = static_cast<int>(TransportLayer::Shm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'TransportAndSizeArgs' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
void TransportAndSizeArgs(benchmark::internal::Benchmark* b)
^| // Generate (payload_size, transport_layer) argument tuples. | ||
| static void TransportAndSizeArgs(benchmark::internal::Benchmark* b) | ||
| { | ||
| for (int layer = static_cast<int>(TransportLayer::Shm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: pointer parameter 'b' can be pointer to const [readability-non-const-parameter]
| for (int layer = static_cast<int>(TransportLayer::Shm); | |
| void TransportAndSizeArgs(const benchmark::internal::Benchmark* b) |
| } | ||
|
|
||
| // Benchmarked section: Send data | ||
| for (auto _ : state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
| for (auto _ : state) | |
| lay_ms));static_cast<int>( |
ecal/benchmarks/pubsub/benchmark_pubsub.cpp:201:
- tSubscriberCount() > 0)
+ tSubscriberCount()) > 0)| void BM_eCAL_Send_and_Receive(benchmark::State& state) | ||
| { | ||
| const size_t payload_size = static_cast<size_t>(state.range(0)); | ||
| const auto layer = static_cast<TransportLayer>(state.range(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'convar' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
;
^| void BM_eCAL_Send_and_Receive(benchmark::State& state) | ||
| { | ||
| const size_t payload_size = static_cast<size_t>(state.range(0)); | ||
| const auto layer = static_cast<TransportLayer>(state.range(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'msg_received' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
;
^| { | ||
| { | ||
| std::lock_guard<std::mutex> lock(mtx); | ||
| msg_received = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
| msg_received = false; | |
| gistration_delay_ms)); | |
| bscriberCount() static_cast<int>(> 0)) |
| { | ||
| { | ||
| std::lock_guard<std::mutex> lock(mtx); | ||
| msg_received = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: implicit conversion 'size_t' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion]
| msg_received = false; | |
| gistration_delay_ms)); | |
| bscriberCount() 0) == 0u |
| BENCHMARK_MAIN(); | ||
| // ------------------------------------------------------------------------ | ||
|
|
||
| BENCHMARK_MAIN(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'BM_eCAL_Send_and_Receive' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
ARK(BM_eCAL_Send_and_Receive)
^
Description
Adapt benchmark, so that it runs for all three Pubsub Transportation types.
Remove the latency benchmark, as this is essentially tested by
Send_Receivebenchmark.