Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2605

FilterHandler should pre-compile regular expression

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • http-2.0.4
    • http-2.2.0
    • HTTP Service
    • None

    Description

      The implementation of FilterHandler has a potential performance problem. Each time the "handle" method is called, it goes through a matching process that includes the following code:

      return uri.matches(this.pattern)

      The problem is that this compiles the regular expression every time this method is called, a potentially expensive operation.

      The pattern should be compiled using Pattern.compile and then re-used for each call to "matches" as follows:

      return this.regex.matcher(uri).matches();

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            dhay David Hay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: