You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2020/09/23 15:14:47 UTC

[GitHub] [cxf] andymc12 commented on a change in pull request #696: [CXF-8345] Improve performance by avoiding resize of MessageImpl

andymc12 commented on a change in pull request #696:
URL: https://github.com/apache/cxf/pull/696#discussion_r493676081



##########
File path: core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
##########
@@ -62,7 +62,7 @@ public void run() {
 
                     Message outMessage = runableEx.getOutMessage();
                     if (outMessage == null) {
-                        outMessage = new MessageImpl();
+                        outMessage = new MessageImpl(16, 1); // perf: size 16 / factor 1 to avoid resize operation

Review comment:
       Yes. It's been a while since we made this change, but I know the performance team tried a few different options and found 16/1 to be the best combination based on the benchmarks they were running.  But I agree with your assessment - this combination is best where there are between 12-16 elements - or rather, it avoids resize between 0-16, but it performs better than the default when where are between 12-16 elements.
   
   Thanks for the review!




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