JAX-RS: Performance Improvement: Don't use IllegalArgumentException to
determine if a URI chunk is a variable or literal
------------------------------------------------------------------------------------------------------------------------
Key: CXF-3262
URL: https://issues.apache.org/jira/browse/CXF-3262
Project: CXF
Issue Type: Improvement
Affects Versions: 2.3.1
Environment: JDK 1.6
Reporter: Ka-Lok Fung
Priority: Minor
Fix For: 2.3.3
Profiling the Apache CXF JAX-RS code shows that more time than necessary is
being spent in UriChunk.createUriChunk because it uses an
IllegalArgumentException to determine whether a URI chunk should be a literal
or a variable. Creating exceptions is expensive :(
Instead of using IllegalArgumentException, perhaps you can have a method that
is like the following:
public static Variable.create(String uriChunk)
where null will be returned if uriChunk is not a variable. This way you can
avoid the overhead of creating the unnecessary stack trace.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.