You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/07/18 09:30:05 UTC

[GitHub] [qpid-dispatch] jiridanek commented on a change in pull request #1303: DISPATCH-2200 Add basic TCP adaptor microbenchmarks

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: dev-unsubscribe@qpid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org