[ https://issues.apache.org/jira/browse/CXF-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986050#action_12986050 ]
Sergey Beryozkin commented on CXF-3262: --------------------------------------- The patch looks perfect to me, thanks > 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 > Components: JAX-RS > Affects Versions: 2.3.1 > Environment: JDK 1.6 > Reporter: Ka-Lok Fung > Priority: Minor > Fix For: 2.3.3 > > Attachments: patch.diff > > Original Estimate: 3h > Remaining Estimate: 3h > > 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.