[Mono-winforms-list] MWF painting VERY slow compared to .NET

Peter De Jager peterdj at telkomsa.net
Wed Jul 27 05:33:50 EDT 2005


When painting a bitmap to a Form and measuring the frame rate, I get vastly
different figures on .NET vs. Mono. E.g. on .NET I get 114 fps while under
mono it's only 4.5 fps (on the same hardware). What's even stranger is that
I get the same (4.5 fps) figure on a PowerPC Mac mini (1.42 GHz G4, 167MHz
bus) and an Intel box (dual 3GHz Xeon, 533MHz bus). Both systems are running
Fedora Core 4. I thought that perhaps it relates to video drivers but I
installed the latest ATI driver on my Xeon box (Radeon 9800 Pro) and there
is still no difference.

Something else is that on WMF, the background is always painted even though
I override OnPaintBackground of my Form with an empty implementation, e.g.:

protected override void OnPaintBackground(PaintEventArgs e) { }

On Windows, this prevents the Form from repainting the background, thus
speeding up painting and reducing flicker, while MWF always appears to
repaint the background.

I've done (very limited) testing on Gtk (Glade), and it appears to be fast
on Linux (comparable to System.Windows.Forms on .NET), but while being fast
on Linux, Glade is MUCH slower on Windows (I don't have exact figures but
it's very noticable).

Is the MWF implementation likely to increase in speed (by 20 times!) as it
matures, or should I use Gtk for Linux / OS X and System.Windows.Forms for
Windows? I was hoping that I could use a single code base for all platforms
(which has been the case so far).

Don't take this the wrong way, I don't mean to be critical. I think it's
great that there is a managed implementation of Windows Forms, but at 20
times slower it renders my Windows applications unusable under Mono.

Thanks
Pete.



More information about the Mono-winforms-list mailing list