Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.5.2
-
Any
-
Novice
Description
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.