[Mono-dev] slow Lockbits

sebi77 balazs.sebestyen at webcamlaboratory.com
Wed Nov 2 07:26:49 EDT 2011


  Hi all!

Our Mono app. significantly slows down on Linux. We figured out that
Lockbits cause this. 
I don't know this problem is a bug, or we can avoid it with memory
management.
What actually happens during LockBits?

http://bugzilla.xamarin.com/show_bug.cgi?id=1819

DateTime start = DateTime.Now;
for (int i = 0; i < 1000; i++)
{
	Bitmap b = new Bitmap(640, 480);
	BitmapData d = b.LockBits(new System.Drawing.Rectangle(0, 0,
		b.Width, b.Height), ImageLockMode.ReadOnly, b.PixelFormat);
	b.UnlockBits(d);
	b.Dispose();   
}
string s = (DateTime.Now - start).TotalMilliseconds.ToString();
Console.WriteLine(s);

Win + .Net:             720 ms
Win + Mono 10.2.3:  750 ms
Lin + Mono:             5000 ms

Sebi

--
View this message in context: http://mono.1490590.n4.nabble.com/slow-Lockbits-tp3972626p3972626.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list