Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 1819 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 805 [details]
Description of Problem:
BitmapData Bitmap.LockBits is slower than .net 3.5 on windows.
Steps to reproduce the problem:
Compile the code and run it.
With Mono on Linux, the test exe runs 4.9-5.0 seconds.
(Only lockbits: 4300 ms, only new bitmap+dispose: 600 ms)
With .NET on Windows, runs 1 second.
How often does this happen?
Ubuntu 11.10 x86, Mono 2.10.5-1
mcs lockbits.cs -r:System.Drawing.dll (or gmcs...)
public static void Main (string args)
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);
string s = (DateTime.Now - start).TotalMilliseconds.ToString();
If someone wants to look at this, the routine to profile and tune lives in libgdiplus: