Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8537

Replace String.replaceAll with substring for better throughput performance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.10
    • 3.5.0, 3.4.4
    • JAX-RS
    • None
    • This would affect all platforms.

    • Unknown

    Description

      Sometime in the JAX-RS 3.3.x branch, the method org.apache.cxf.jaxrs.utils.JAXRSUtils.combineUriTemplates was introduced. This method calls a costly String.replaceAll in order to remove a '/' character at the end of a uri. This method can perform up to 2% better in throughput scenarios by changing:

      return parent.replaceAll("/$", "") + child;

      to

      return parent.substring(0, parent.length() - 1) + child;

       

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            joshuad Joshua Dettinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: