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

Vladimir Moushkov vlindos at nucleusys.com
Wed Jul 27 05:52:51 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.
if you have searched the mailing list would known that drawing issues are
it's known problem.
> 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.:
nasty nasty bugs
> 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).
Glade uses GDK for drawing, while Winforms uses Cairo
> 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).
I hope that too.

> 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.
Slowness of MWF drawing comes from Cairo. MWF uses libgdiplus for drawing,
libgdiplus uses cairo/libpixmain backends for drawing and uses version
0.3.0 of Cairo. Currently Cairo is version 0.5.2. The problem is that
Cairo isn't yet stable project as API is changed even on minor version
change. On mailing lists of Cairo there is talk of soon releasing of
version 1 which means freezing the API. But 'soon' could be month or year
by my opinion. Hower I am interested ( as seems as you) in mature MWF
applications - so I
've started porting libgdi to current cairo and expect big difference in
performance - if you interested in helping me - tell me. If you not there
are other issues for MWF which should be done: theming, icons and others -
ask the core developers.

Best regards,
Vl. Moushkov
> Thanks
> Pete.
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list

More information about the Mono-winforms-list mailing list