[ 
https://issues.apache.org/jira/browse/JCLOUDS-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13780555#comment-13780555
 ] 

ASF subversion and git services commented on JCLOUDS-302:
---------------------------------------------------------

Commit 73464c3877c4c2106ed22b5825228de752840793 in branch refs/heads/master 
from [~ntolia]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-jclouds.git;h=73464c3 ]

[JCLOUDS-302] Remove unnecessary String construction in HttpUtils

                
> Prevent unnecessary HttpMessage String generation in HTTPUtils
> --------------------------------------------------------------
>
>                 Key: JCLOUDS-302
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-302
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-core
>    Affects Versions: 1.7.0, 1.6.2
>            Reporter: Niraj Tolia
>            Priority: Trivial
>             Fix For: 1.7.0, 1.6.2
>
>
> HttpUtils.checkRequestHasRequiredProperties() has a number of Preconditions 
> checks that generate an error string using concatenation. In particular, the 
> HttpMessage being checked is added to the error string multiple times and 
> this invokes the HttpMessage.toString() function. This generated String is 
> promptly thrown away in the majority of cases where the Preconditions checks 
> are not triggered.
> This wasted work shows up as a hotspot in my microbenchmark profiling in 
> terms of object allocation (8% of total allocations). While fixing it by 
> switching to using the String format version of the Preconditions API does 
> lead to a measurable improvement, the improvement is small. However, this is 
> a low risk change to make and I will therefore push a patch for review.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to