JAX-RS: Avoid implicit use of regular expression in JAXRSUtils.intersectMimeTypes ---------------------------------------------------------------------------------
Key: CXF-3285 URL: https://issues.apache.org/jira/browse/CXF-3285 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 While profiling CXF 2.3.1, we found that a small hotspot in JAXRSUtils.intersectMimeTypes. Splitting on + triggers the Pattern to be compiled twice and caused unnecessary code to be run because you're only interested in strings that only have one +. When we replaced that code with equivalent code using String.indexOf and String.substring, the code was ~3% faster. In terms of absolute time in milliseconds here are the values (the test involved 1 million requests), Index of and substring: 2635933-361906=2274027 No intersect improvement: 2724713-367039=2357674 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.