Just as an extra note-

Before the change, there were 130000 regex comparisons in one of our projects.

The change reduces this to 128000 string comparisons (taking less than 1% of the time) and 2000 regex comparisons (taking the remaining 60% of the time). Note that all numbers are approximate from profiling- you can use nprof to get some of your own if you wish.

I'm considering adding regex compilation to the mix, avoiding some of the Regex.Match overhead (since the regexes should only be compiled once for a single build file). I'm not certain if the overhead of compiling regexes would overwhelm the savings, but I'm more confident now that the majority of generated regular expressions (ie: filesets passed to subtasks) are now simple regular expressions.

The remaining regular expressions are likely the ones passed by the build file author themselves, along with some of the built-in ones like **/CVS/**, etc. If we cache the compiled

Matt.

Matthew Mastracci wrote:

I just checked in a change to fileset scanning that eliminates a large chunk of time (checked via profiling) during many of the common NAnt operations.

One of the biggest losers on the profiling run was Regex.Match(), called many, many times during a build. The new code replaces a good proportion of these with CompareInfo.Compare() calls, reducing the overhead dramatically.

Instead of converting all <fileset> includes to regexes, the new code will only convert those that actually contain wildcards.

Matt.


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to