Possible Optimization

Jan 11, 2010 at 3:31 AM

For a blit where "BlendMode == None" and "Color == White", it may be possible to do a line by line copy using Buffer.BlockCopy(...).

I believe Buffer.BlockCopy is extremely fast relative to a for loop when copying/appending arrays.


Jan 11, 2010 at 9:28 AM
Edited Jan 11, 2010 at 9:42 AM

That's a good point Jeremiah. It should really be much faster.

I will try it and come back to let you know. Thanks for the hint.

- Rene

Jan 11, 2010 at 9:45 AM

I've just implemented a fastpath in Blit() for BlendMode.None and Colors.White and commited the changes to the repository (r 36729). Buffer.BlockCopy is much faster and I got a performance boost by factor 3.5.

Thanks again for your suggestion.