Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-715

CharSetUtils.squeeze() speedup

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:

      Description

      The attached patch speeds up CharSetUtils.squeeze() by avoiding unnecessary calls to CharSet.contains(). It should not slow down any cases, and in my tests with some use cases that I consider fairly common ones I got up to sixfold speedups with the patch.

      It's not that squeeze() would be that slow in the first place before the patch; I just happened to be playing around with caliper (http://code.google.com/p/caliper/) and squeeze() was one of the first things I tried it with.

        Attachments

        1. squeeze-speedup.patch
          0.7 kB
          Ville Skyttä

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              scop Ville Skyttä
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: