[ 
https://issues.apache.org/jira/browse/CXF-4134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Freeman Fang resolved CXF-4134.
-------------------------------

    Resolution: Fixed

Also add and reuse a ENCODINGS pattern.
@Matt
Thanks for the reminder!
                
> GZIPOutInterceptor compiles Patterns constantly; they should be compiled once 
> and reused
> ----------------------------------------------------------------------------------------
>
>                 Key: CXF-4134
>                 URL: https://issues.apache.org/jira/browse/CXF-4134
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core, Transports
>    Affects Versions: 2.5.2
>         Environment: Any
>            Reporter: Matt Bishop
>            Assignee: Freeman Fang
>            Priority: Minor
>              Labels: perfomance
>             Fix For: 2.3.10, 2.4.7, 2.5.3, 2.6
>
>
> GZIPOutInterceptor (lines 193 to 195) use two regular expressions to search 
> for a pattern in a string. They compile the regex on every call, and on every 
> pass through a loop:
>   Pattern zeroQ = Pattern.compile(";\\s*q=0(?:\\.0+)?$");
>   for (String headerLine : acceptEncodingHeader) {
>     String[] encodings = headerLine.trim().split("[,\\s]*,\\s*");
> Compiling patterns is not cheap; please move these patterns (including the 
> String.split() pattern) into the constructor or a static member so we don't 
> keep recompiling the pattern.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to