[Mono-dev] Patch to boost speed of UnicodeEncoding

Atsushi Eno atsushi at ximian.com
Wed Mar 15 17:10:41 EST 2006


It's always nice if encoding conversion stuff get faster. Can you
also provide how it becomes faster when you finish writing the patch?

Atsushi Eno

Kornél Pál wrote:
> Hi,
> I think doing something like in the attached draft is faster. No new String
> object is created. Arrays are accessed using pointers. And I think there is
> no use to use a more complicated conversion method for short strings.
> This draft is very unsafe. It lacks of any checks and does not perform any
> special character or byte sequence handling.
> Note that I haven't done any tests to determine whether using byte pointer
> or using int pointers and shift operations to swap bytes is faster. But
> mixing bytes an ints results in two different code for big and little 
> endian
> encodings while byte swapping can be performed using a single code when
> using only bytes or only ints.
> Kornél

More information about the Mono-devel-list mailing list