[Mono-dev] mcs patch to say goodbye to SeekableStreamReader
Atsushi Eno
atsushi at ximian.com
Wed Aug 31 00:54:08 EDT 2005
Hi,
I just commited and reverted the patch - gmcs seems pretty complex
on those tokenization matter than mcs. I'll try to make those
changes on gmcs directly.
Atsushi Eno
Miguel de Icaza wrote:
> Hello,
>
>> I agree that xtoken() could be performance sensitive, but on the
>> other hand, current code moves back the stream, which results in
>> extraneous parse on every parenthesized expressions. Actually
>> as mentioned later, the patched code seems faster. Note that
>> SeekableStreamReader has to call encoding GetCharCount() when
>> we reposition the stream.
>
> Good point. Thanks for the benchmarks, lets get this patch into SVN.
>
>> Actually the resulting performance is better than existing code:
>>
>> existing code at *best*:
>> real 0m2.711s
>> user 0m0.080s
>> sys 0m0.050s
>>
>> Total memory allocated: 34835 KB
>>
>> patched code at *worst*:
>> real 0m2.635s
>> user 0m0.020s
>> sys 0m0.030s
>> Total memory allocated: 34083 KB
>>
>> Most of the memory consumption difference comes from
>> SeekableStreamReader:
>
> Lovely, thanks for the patch and the measurements.
>
>> ########################
>> 731 KB Mono.CSharp.SeekableStreamReader::.ctor(StreamReader)
>> 731 KB 363 System.Char[]
>> Callers (with count) that contribute at least for 1%:
>> 363 100 % Mono.CSharp.SeekableStreamReader::.ctor(Stream,Encoding)
>>
>> Atsushi Eno
More information about the Mono-devel-list
mailing list