Jörg Hoh created FELIX-5287:
-------------------------------
Summary: [SSLFilter] use Integer.parseInt instead of
Integer.valueOf
Key: FELIX-5287
URL: https://issues.apache.org/jira/browse/FELIX-5287
Project: Felix
Issue Type: Improvement
Components: HTTP Service
Affects Versions: http.sslfilter-1.0.8
Reporter: Jörg Hoh
Priority: Minor
SslFilterRequest.getPort() uses Integer.valueOf to extract the port from the
header, but just returns the primitive type. Thus it relies on the
auto-unboxing, which takes a bit of time.
But according to a yourkit profiling run this takes about 0.5% of the total
request time for my application (which normally make me ignore such things, and
I still find it very hard to believe), but because it's such an easy change we
should do it.
A quick-and-dirty test shows, that
{noformat}
for (int i=0;i<100000;i++) {
int result = Integer.valueOf(value);
}
{noformat}
takes 300% of the execution time of
{noformat}
for (int i=0;i<100000;i++) {
int result = Integer.parseInt(value);
}
{noformat}
(both running on Java 1.8.0_65)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)