See here:
|
public Reader filterRuleSetFile(InputStream stream) throws IOException { |
|
byte[] bytes = IOUtils.toByteArray(stream); |
|
String encoding = determineEncoding(bytes); |
|
String ruleset = new String(bytes, encoding); |
|
|
|
ruleset = applyAllFilters(ruleset); |
|
|
|
return new StringReader(ruleset); |
|
} |
applyAllFilters performs a bunch of regex replacements on the entire String, which creates many copies of it. We could do better by only filtering the ref attributes when parsing a rule reference node, this just seems very inefficient.
@jsotuyod This may offset your performance comparison of DOM and SAX for #724
See here:
pmd/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java
Lines 108 to 116 in 0c1afc4
applyAllFiltersperforms a bunch of regex replacements on the entire String, which creates many copies of it. We could do better by only filtering therefattributes when parsing a rule reference node, this just seems very inefficient.@jsotuyod This may offset your performance comparison of DOM and SAX for #724