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/01/14 15:31:00 UTC

[GitHub] [qpid-proton] jiridanek opened a new pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

jiridanek opened a new pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286


   


----------------------------------------------------------------
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.

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


[GitHub] [qpid-proton] jiridanek merged pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
jiridanek merged pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286


   


-- 
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.

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


[GitHub] [qpid-proton] jiridanek commented on a change in pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
jiridanek commented on a change in pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#discussion_r557482607



##########
File path: c/benchmarks/message-encoding.cpp
##########
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include <unistd.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "proton/connection_driver.h"
+#include "proton/engine.h"
+#include "proton/log.h"
+#include "proton/message.h"
+
+#include <benchmark/benchmark.h>
+#include <core/data.h>
+#include <proton/listener.h>
+#include <proton/netaddr.h>
+#include <proton/proactor.h>
+#include <proton/sasl.h>
+#include <wait.h>
+
+/** Initialize message, don't decode?
+ * Issues:
+ *   PROTON-2229 pn_data_t initialization lead to low performance
+ */
+static void BM_Encode10MbMessage(benchmark::State &state) {
+    const size_t size = 10*1024*1024;
+    char * payload = static_cast<char *>(malloc(size));
+    pn_bytes_t bytes = pn_bytes(size, payload);
+
+    for (auto _ : state) {
+        pn_message_t *message = pn_message();
+        pn_data_t *   body = pn_message_body(message);
+        for (size_t i = 0; i < state.range(0); i++) {
+            pn_data_put_binary(body, bytes);

Review comment:
       this is the case where +2 is better; if I call put_binary multiple times (whatever that actually ends up doing)




----------------------------------------------------------------
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.

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


[GitHub] [qpid-proton] jiridanek commented on a change in pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
jiridanek commented on a change in pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#discussion_r557482071



##########
File path: c/benchmarks/message-encoding.cpp
##########
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include <unistd.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "proton/connection_driver.h"
+#include "proton/engine.h"
+#include "proton/log.h"
+#include "proton/message.h"
+
+#include <benchmark/benchmark.h>
+#include <core/data.h>
+#include <proton/listener.h>
+#include <proton/netaddr.h>
+#include <proton/proactor.h>
+#include <proton/sasl.h>
+#include <wait.h>

Review comment:
       TODO: unused imports




----------------------------------------------------------------
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.

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


[GitHub] [qpid-proton] jiridanek commented on pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
jiridanek commented on pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#issuecomment-822377843


   Travis results https://travis-ci.com/github/apache/qpid-proton/jobs/499408632#L2988
   
   ```
   1: -------------------------------------------------------------------------------------
   1: Benchmark                                           Time             CPU   Iterations
   1: -------------------------------------------------------------------------------------
   1: BM_Encode10MbMessage/put_binary count:1          1.36 ms         1.36 ms          571
   1: BM_Encode10MbMessage/put_binary count:2          34.1 ms         34.1 ms           20
   ```


-- 
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.

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


[GitHub] [qpid-proton] jiridanek commented on a change in pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
jiridanek commented on a change in pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#discussion_r557915002



##########
File path: c/benchmarks/message-encoding.cpp
##########
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include <unistd.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "proton/connection_driver.h"
+#include "proton/engine.h"
+#include "proton/log.h"
+#include "proton/message.h"
+
+#include <benchmark/benchmark.h>
+#include <core/data.h>
+#include <proton/listener.h>
+#include <proton/netaddr.h>
+#include <proton/proactor.h>
+#include <proton/sasl.h>
+#include <wait.h>
+
+/** Initialize message, don't decode?
+ * Issues:
+ *   PROTON-2229 pn_data_t initialization lead to low performance
+ */
+static void BM_Encode10MbMessage(benchmark::State &state) {
+    const size_t size = 10*1024*1024;
+    char * payload = static_cast<char *>(malloc(size));
+    pn_bytes_t bytes = pn_bytes(size, payload);
+
+    for (auto _ : state) {
+        pn_message_t *message = pn_message();
+        pn_data_t *   body = pn_message_body(message);
+        for (size_t i = 0; i < state.range(0); i++) {
+            pn_data_put_binary(body, bytes);
+        }
+
+        pn_message_free(message);
+    }
+
+    free(payload);
+}
+
+BENCHMARK(BM_Encode10MbMessage)
+->Arg(1)
+->Arg(10)
+->ArgName("put_binary count")

Review comment:
       The idea here is that framework runs test twice, first the arg is 1, then it is 10. The arg is used as iteration count for the nested for-loop, so how many times `pn_data_put_binary` gets called.




----------------------------------------------------------------
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.

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


[GitHub] [qpid-proton] codecov-io commented on pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#issuecomment-760603893


   # [Codecov](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=h1) Report
   > Merging [#286](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=desc) (45d2df1) into [master](https://codecov.io/gh/apache/qpid-proton/commit/ebfe89f10e9f16e9347ebdb766480b7f4fdb5780?el=desc) (ebfe89f) will **decrease** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/qpid-proton/pull/286/graphs/tree.svg?width=650&height=150&src=pr&token=UKKzV9XnFF)](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #286      +/-   ##
   ==========================================
   - Coverage   79.81%   79.79%   -0.02%     
   ==========================================
     Files         342       46     -296     
     Lines       43235     2341   -40894     
   ==========================================
   - Hits        34506     1868   -32638     
   + Misses       8729      473    -8256     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [ruby/lib/handler/reactor\_messaging\_adapter.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvaGFuZGxlci9yZWFjdG9yX21lc3NhZ2luZ19hZGFwdGVyLnJi) | `32.55% <0.00%> (-58.14%)` | :arrow_down: |
   | [ruby/lib/handler/messaging\_handler.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvaGFuZGxlci9tZXNzYWdpbmdfaGFuZGxlci5yYg==) | `57.14% <0.00%> (-35.72%)` | :arrow_down: |
   | [ruby/lib/core/message.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29yZS9tZXNzYWdlLnJi) | `57.05% <0.00%> (-31.77%)` | :arrow_down: |
   | [ruby/lib/util/deprecation.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvdXRpbC9kZXByZWNhdGlvbi5yYg==) | `70.58% <0.00%> (-29.42%)` | :arrow_down: |
   | [ruby/lib/util/error\_handler.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvdXRpbC9lcnJvcl9oYW5kbGVyLnJi) | `59.37% <0.00%> (-28.13%)` | :arrow_down: |
   | [ruby/lib/codec/data.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29kZWMvZGF0YS5yYg==) | `69.56% <0.00%> (-26.53%)` | :arrow_down: |
   | [ruby/lib/core/uri.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29yZS91cmkucmI=) | `74.07% <0.00%> (-25.93%)` | :arrow_down: |
   | [ruby/lib/core/condition.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29yZS9jb25kaXRpb24ucmI=) | `80.64% <0.00%> (-19.36%)` | :arrow_down: |
   | [ruby/lib/core/session.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29yZS9zZXNzaW9uLnJi) | `80.76% <0.00%> (-7.70%)` | :arrow_down: |
   | [ruby/lib/core/endpoint.rb](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree#diff-cnVieS9saWIvY29yZS9lbmRwb2ludC5yYg==) | `88.23% <0.00%> (-5.89%)` | :arrow_down: |
   | ... and [300 more](https://codecov.io/gh/apache/qpid-proton/pull/286/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=footer). Last update [ebfe89f...45d2df1](https://codecov.io/gh/apache/qpid-proton/pull/286?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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


[GitHub] [qpid-proton] codecov-io edited a comment on pull request #286: PROTON-2321 Add benchmark for pn_data_t initialization from PROTON-2229

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #286:
URL: https://github.com/apache/qpid-proton/pull/286#issuecomment-760603893






----------------------------------------------------------------
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.

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