[Mono-dev] BitArray patch

David Brown mono at davidb.org
Mon Mar 26 21:57:59 EDT 2007


Alan McGovern wrote:

> I was just looking at the bitarray code and i thought that instead
> of a lot of bitshifting and messing to retrieve individual bytes
> from int's it would be faster (and easier?) to use unsafe code and
> mess with individual bytes that way. This patch makes it about 20%
> faster to create a bit array from an int[].

What about byte ordering, though?  The code being replaced seems to
always extract as if the data were little endian, but the unsafe code
will depend on the endianness of the platform we're running on.

Dave




More information about the Mono-devel-list mailing list