[Mono-devel-list] Nant / OJB.NET / Maverick.NET / NVelocity

Paolo Molaro lupus at ximian.com
Tue Oct 7 10:44:54 EDT 2003


On 10/06/03 Todd Berman wrote:
> Lupus, the issue is the entire Regex engine of mono, a known, and
> documented mono issue. Filing a mono bug doesn't seem to make sense. 

So, if someone has taken the time to actually find that the 'entire'
Regex engine is at fault (that means reviewing 5000+ lines of code,
writing tests and benchmarks), why hasn't he taken an additional 30
seconds to file a bugzilla report? As is almost always the case,
probably the nant issue depends mainly on few separated issues.

For example, since the DirectoryScanner code was pointed out, I just
modified it to add a few regexes that might have been used in a nant
build and ran it over my corlib directory using --profile.
Sure enough a specific method was taking most of the time.
The included patch removes the use of the dumb code and now
a run takes .7 seconds instead of 2.5 (note that the QuickSearch class
can be removed completely and the code optimized further).
It's not bad getting a 3X+ speedup with a three line patch: maybe, just
maybe, the 'entire Regex engine' is not so bad as you make it sound.
The same program on a windows box that is 3 times slower than mine takes
1.3 seconds, so there are still improvements to be made, but sure it's
not unusable.
Does this change help addressing the nant issue? Maybe, but since people
prefer to whine on irc or in the list instead of filing good bug 
reports, we don't know. They just made people avoid using nant and/or
mono, when instead the fix *might* have been so simple and might have
been done a lot of time ago.
Please, the people who had the issue: care to apply the patch in
mcs/class/System/System.Text.RegularExpressions and report if it helps?
Thanks.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

Index: quicksearch.cs
===================================================================
RCS file: /cvs/public/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs,v
retrieving revision 1.1
diff -u -p -r1.1 quicksearch.cs
--- quicksearch.cs	31 Jan 2002 08:00:16 -0000	1.1
+++ quicksearch.cs	7 Oct 2003 13:30:19 -0000
@@ -20,7 +20,7 @@ namespace System.Text.RegularExpressions
 			this.len = str.Length;
 			this.ignore = ignore;
 		
-			Setup ();
+			//Setup ();
 		}
 		
 		public string String {
@@ -49,7 +49,7 @@ namespace System.Text.RegularExpressions
 					}
 
 					if (ptr < end)
-						ptr += shift[text[ptr + len]];
+						ptr++;
 					else
 						break;
 				}
@@ -66,7 +66,7 @@ namespace System.Text.RegularExpressions
 					}
 
 					if (ptr < end)
-						ptr += shift[text[ptr + len]];
+						ptr++;
 					else
 						break;
 				}



More information about the Mono-devel-list mailing list