hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1471) ResponseCachingPolicy - eliminate boxing and HashSet
Date Sun, 14 Sep 2014 13:35:34 GMT

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

Sebb commented on HTTPCLIENT-1471:
----------------------------------

Note that boxing overhead also needs to be taken into account for the Set variant.
Probably won't make much difference, but also probably not negligible.

Sharing the fixed uncacheableStatuses lists would save re-creating them, at the expense of
creating them even if not actually needed.
This expense could be eliminated with an IODH if necessary.

> ResponseCachingPolicy - eliminate boxing and HashSet
> ----------------------------------------------------
>
>                 Key: HTTPCLIENT-1471
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1471
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpCache
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 4.4 Final
>
>
> ResponseCachingPolicy uses 2 HashSets containing a few Integers each for matching int
values.
> This involves lots of boxing plus the overhead of the hashSet.
> Since the numbers of integers involved is very small - at most 6 - it seems unnecessary
to use hashing. A linear search would likely be quicker.
> If the number of entries were to be rather larger, then Arrays#binarySearch might be
better.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message