ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/types/selectors SelectorUtils.java
Date Tue, 15 Jul 2003 14:40:18 GMT
On 14 Jul 2003, <antoine@apache.org> wrote:

>   Optimize DirectoryScanner to take advantage of include patterns
>   which are not beginning with wildcards PR: 20103

I'm not sure I understand what you've done, I'll try to come up with
some unit tests if I think something is wrong 8-)

Some notes:

* SelectorUtils#rtrimWildcardTokens should probably short circuit and
return the original input if the input doesn't contain any wildcards
at all.

* the same method may become faster if you'd use tokenizePathAsArray
instead of tokenizePath, even though I've never verified any speedup
myself.

* You go a long way to avoid redundantly adding patterns in
DirectoryScanner#checkIncludePatterns (the parent check).  If the
patterns come in reversed, you'll still have duplicate roots, no?  Say
a/b/c is added before a/b is.  You may avoid this by sorting the
include patterns first.

* If all patterns are plain files, i.e. no "pattern" contains any
wildcards, things could still be improved by not performing any
pattern matching at all.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message