Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4488

Improve performance of DefaultExcludedPatternsChecker

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.3.20
    • 2.3.24
    • Core Interceptors
    • None

    Description

      The current set of patterns can be consolidated without sacrificing readability for a significant gain in efficiency. I ran both sets of equivalent patterns against the three test methods in DefaultExcludedPatternsCheckerTest 100,000 times, and the consolidated pattern was 3 times faster.

          public static final String[] EXCLUDED_PATTERNS = {
              "(.*\\.|^|.*|\\[('|\"))\\bclass(\\.|('|\")]|\\[).*",
              "(^|.*#)(dojo|struts|session|request|application|servlet(Request|Response)"
               + "|parameters|context|_memberAccess)(\\.|\\[).*"
          };
      

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            perfnorm Jasper Rosenberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: