[mono-vb] Mono 2.6.3 and performance

Rolf Bjarne Kvinge rolflists at ya.com
Tue Apr 20 18:57:32 EDT 2010


Hi,

> 
> Recently, I wanted to run a Visual Basic application under Mono. The
> application itself has to do mainly with cryptography and involves a
> lot of DES operations, byte crunching/converting, TCP/IP but not much more
and
> no disk I/O. The core functionality is implemented in a DLL and is wrapped
> around a simple Winforms project with a few options. My initial goal
> was to take everything needed to run the GUI, copy it to a Linux distro
and
> have it run under Mono without performing any compilation under Linux.
> 
> I quickly discovered that I had to target Mono 2.6 in order to reach my
> goal, so I aimed for openSUSE 11.2 with Mono 2.6.3. Initially, my
> efforts failed because calls to the VB namespace were returning incorrect
> results. I had to replace a lot of CType, CInt, CBool, CByte, CLng, Asc,
Chr
> method calls with calls to various classes of the System namespace. After
some
> work at that, I was able to run the GUI application under openSUSE
> successfully. A few errors still remain but I have worked around those.

Have in mind that reporting errors back to us (either via
bugzilla.novell.com or in this mailing list) is the best way to get these
issues fixed eventually :)

> 
> What striked me was the performance of the application under Mono. I
> have a way to stress-test my application. I fired it up and started to
stress-
> test the application under Mono. Normally, the GUI application shows
status
> messages and informs the user about what is happening. When the status
> messages where displayed, the application performed pitifully under
> openSUSE. Once the status messages were disabled, the application
> worked faster under openSUSE than under Windows. I was running openSUSE
under
> VMWare and the stress test application in the Windows VM host. The GUI
> application took 59 seconds to finish when running in the Windows VM
> host but only 46 seconds when running in the openSUSE virtual machine. In
> both cases, the stress test executes the same commands serially (single
> thread) and screen output was turned off.
> 
> That strikes me as a bit odd. I've heard before that Winforms projects
> under Mono perform poorly but my experience seems to suggest that server-
> based applications perform better under Mono than under Windows. The
ported
> application doesn't use anything like WCF, Remoting (and thus
> serialization) so I don't know how Mono fares on those. Still, these
results caught me
> by surprise - I was just curious about the performance of Mono when I
> started the stress test but now I keep wondering how is that performance
> difference possible.
> 
> I apologize for the elongated post but I'd just like to check my sanity
> here. Am I missing something or is this considerable speed improvement
> to be expected and, most important, why is this so?

It's not really to be expected, but these things do happen. I think you have
hit something that for some reason is faster in mono (maybe our
implementation of some of the base class libraries you use have been more
optimized, or you hit something in the jit we happen to generate better code
for). It's hard to say without knowing exactly what is running faster in
your application.

And your sanity should be checked by tests confirming that mono gives the
same output as on windows :) If that is the case, you should have nothing to
worry about. If not, please file bugs and we'll fix them.

Rolf 

> --
> View this message in context: http://n4.nabble.com/Mono-2-6-3-and-
> performance-tp2017537p2017537.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb



More information about the Mono-vb mailing list