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

Improve performance of DefaultExcludedPatternsChecker

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.3.20
    • Fix Version/s: 2.3.24
    • Component/s: Core Interceptors
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: