You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Niraj Tolia (JIRA)" <ji...@apache.org> on 2013/09/27 21:57:03 UTC

[jira] [Commented] (JCLOUDS-302) Prevent unnecessary HttpMessage String generation in HTTPUtils

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

Niraj Tolia commented on JCLOUDS-302:
-------------------------------------

Pull request at https://github.com/jclouds/jclouds/pull/158
                
> 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