struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasper Rosenberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (WW-4488) Improve performance of DefaultExcludedPatternsChecker
Date Thu, 09 Apr 2015 11:38:12 GMT
Jasper Rosenberg created WW-4488:
------------------------------------

             Summary: Improve performance of DefaultExcludedPatternsChecker
                 Key: WW-4488
                 URL: https://issues.apache.org/jira/browse/WW-4488
             Project: Struts 2
          Issue Type: Improvement
          Components: Core Interceptors
    Affects Versions: 2.3.23, 2.3.20
            Reporter: Jasper Rosenberg
            Priority: Trivial


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.

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message