[ https://issues.apache.org/jira/browse/CXF-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy McCright updated CXF-7075: ------------------------------- Attachment: JAXRSUtils-parseMediaType-perfTest.zip Here is the performance test case I used. The test just parses some of the default media types. It tests parsing one media type (no comma separation), two media types (one comma), three media types, and 12 media types. I ran the original code then the proposed code and back and forth a few times to try to filter out anything else that is running on my machine (still not the cleanest for a true performance test, but it's what I have to work with... :) ), and here are my results: Original Code Test Time to parse one type: 138693018 nanoseconds Time to parse two types: 77448126 nanoseconds Time to parse three types: 78393247 nanoseconds Time to parse twelve types: 392029699 nanoseconds Proposed Change Test Time to parse one type: 137286698 nanoseconds Time to parse two types: 69548647 nanoseconds Time to parse three types: 71362712 nanoseconds Time to parse twelve types: 408572018 nanoseconds Original Code Test Time to parse one type: 139692204 nanoseconds Time to parse two types: 72788203 nanoseconds Time to parse three types: 79289730 nanoseconds Time to parse twelve types: 439972027 nanoseconds Proposed Change Test Time to parse one type: 137032626 nanoseconds Time to parse two types: 69043698 nanoseconds Time to parse three types: 77564601 nanoseconds Time to parse twelve types: 385392535 nanoseconds Original Code Test Time to parse one type: 148664661 nanoseconds Time to parse two types: 73345793 nanoseconds Time to parse three types: 79363398 nanoseconds Time to parse twelve types: 412479763 nanoseconds Proposed Change Test Time to parse one type: 139838947 nanoseconds Time to parse two types: 73356785 nanoseconds Time to parse three types: 76625311 nanoseconds Time to parse twelve types: 383566071 nanoseconds > Remove unnecessary string.length() and map.containsKey(...) calls to improve > performance > ---------------------------------------------------------------------------------------- > > Key: CXF-7075 > URL: https://issues.apache.org/jira/browse/CXF-7075 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Affects Versions: 3.1.7 > Reporter: Andy McCright > Attachments: JAXRSUtils-parseMediaType-perfTest.zip > > Original Estimate: 24h > Remaining Estimate: 24h > > Using a simple (echo) JAX-RS benchmark, we've found a few hot spots around > string.length() and map.containsKey(...) calls that could be optimized. > Initial testing with the proposed changes yielded about a 2-3% improvement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)