[Mono-list] mcs compiles on linux. Now what?
Paolo Molaro
lupus@ximian.com
Fri, 8 Mar 2002 17:13:34 +0100
On 03/08/02 Miguel de Icaza wrote:
> > 45-50 % of the time is spent parsing, now. miguel mentioned he had a few
> > ideas about ways to speed-up the parser, maybe when he wakes up
> > he can elaborate. Loading the file in memory at once is sure worth,
> > but this should probably be implemented at the IO.FileStream level.
>
> We need to run mcs with --timestamps in both Linux and Windows. The
> first time stamp shown is the parsing time. In my Windows machine, this
We need to implement formatting output first :-)
> So 1/15h of the time is spent on parsing on Windows. If we are getting
> different numbers on Linux, we should not look into optimizing the
> parser and the tokenizer, but optimizing the underlying functions.
Here is StringBuilder::Append(char):
public StringBuilder Append( char value ) {
return Append (value, 1);
}
public StringBuilder Append( char value, int repeatCount) {
if( repeatCount < 0 ) {
throw new ArgumentOutOfRangeException();
}
return Append( new String( value, repeatCount));
}
Append(string) will have to call String.ToCharArray() to get back the
char. I changed this to do the obvious thing, and the time to compile
mcs (with a debug mint build) went from 5m28s to 4m29s, not bad :-)
> > 15 % is spent in String.BoyerMoore: a dumb search is sure faster than
> > initializing a 65536 element skiptable :-)
>
> Heh, is this initialized for every string? Oh my
Every time you call String.IndexOf (string).
lupus
--
-----------------------------------------------------------------
lupus@debian.org debian/rules
lupus@ximian.com Monkeys do it better