jiridanek commented on a change in pull request #1303:
URL: https://github.com/apache/qpid-dispatch/pull/1303#discussion_r671813088
##########
File path: tests/c_benchmarks/bm_tcp_adapter.cpp
##########
@@ -103,3 +221,143 @@ static void
BM_TCPEchoServerLatencyWithoutQDR(benchmark::State &state)
}
BENCHMARK(BM_TCPEchoServerLatencyWithoutQDR)->Unit(benchmark::kMillisecond);
+
+class DispatchRouterThreadTCPLatencyTest
+{
+ QDR mQdr{};
+ std::thread mT;
+
+ public:
+ DispatchRouterThreadTCPLatencyTest(const std::string configName)
+ {
+ Latch mx;
+
+ mT = std::thread([&mx, this, &configName]() {
+ mQdr.initialize(configName);
+ mQdr.wait();
+
+ mx.notify();
+ mQdr.run();
+
+ mQdr.deinitialize(false);
+ });
+
+ mx.wait();
+ }
+
+ ~DispatchRouterThreadTCPLatencyTest()
+ {
+ mQdr.stop();
+ mT.join();
+ }
+};
+
+class DispatchRouterSubprocessTcpLatencyTest
+{
+ int pid;
+
+ public:
+ DispatchRouterSubprocessTcpLatencyTest(std::string configName)
+ {
+ pid = fork();
Review comment:
I really like this! Since dispatch is compiled in, it can be exec'd by
forking the test/benchmark process. With (considerable) work, it would be
possible to even have two-way interactions with the forked process, using some
Linux IPC... Just running qdmanage is simpler and probably better, though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]