[Mono-dev] [PATCH] Speed up ByteEncoding.GetString()

Miguel de Icaza miguel at ximian.com
Wed Jun 7 00:48:29 EDT 2006


Hello Kornel,

> ByteEncoding.GetString() currently uses StringBuilder that is very slow. I 
> modified it to use InternalAllocateStr and unsafe code that makes is much 
> faster.
> 
> Please review and approve the patch.

Am not sure that poking at the internals and using InternalAllocateStr
is a good idea.   One possibility would be to use "Friend Assemblies",
although that is only supported in the 2.0 profile, not in 1.0.

Although today Mono does not enforce at runtime accessibility, this is
something that we intend to fix, which means that access to internal
methods will at some point broken.   So this would be one of those
things we would have to fix.

(Today we do violate this rule when using dynamic method invocation, and
we would have to find solutions for the places where we do).

Miguel.



More information about the Mono-devel-list mailing list