Sector 0

March 31, 2008

Mono vs. Microsoft : bout 2

Filed under: .NET,Mono.NET,Programming — Tags: , , — frank @ 19:42

After posting the previous blog entry on Mono IL code, Marek Safar and Miguel de Icaza from the Mono team noticed that I had made the rather embarassing mistake of compiling the code in debug-mode when compiling with Microsofts compiler. That left me with quite a red face, but now is the time to do it properly.

For this test I have written a small application that computes prime numbers using a rather inefficient but simple algorithm. The program calculates the prime numbers between 2 and 100,000 (yeah, I just love primes). This is done 1,000 times and the average execution time is displayed. (more…)

March 11, 2008

Is Mono.NET generating better IL code than Microsoft.NET?

Filed under: .NET,Mono.NET,Programming — Tags: , , — frank @ 19:35

When working on RemotingLite and MPAPI I came across a couple of oddities, and a single fact that one might expect:

  1. Mono”s gmcs.exe compiler generates much less IL code than Microsofts csc.exe.
  2. Code compiled with Mono”s compiler runs more efficiently on Microsofts runtime than code generated with Microsofts compiler.
  3. Code compiled with Mono”s compiler runs significantly slower on Mono”s runtime than Microsoft-compiled code on Microsofts runtime.

Keep in mind that this has only been tested with a couple of applications, and that Mono might not be fully optimized to run on my laptop with Windows XP as an operating system. For that this little test cannot be thought of as anything remotely conclusive. Furthermore I am not an expert on Mono, and perhaps I have left out some compiler optimizations that I am simply unaware of. If that is the case then please contact me.

Test setup

For this test I have compiled the RemotingLite v.1.2.3 and MPAPI v.1.0 frameworks with gmcs.exe. I have Mono 1.2.6.0 and Microsoft .NET 2.0 and 3.0 installed on my system. The tests have been done with the two sample applications I wrote for the MPAPI framework. (more…)

March 8, 2008

Distributed MPAPI v. 1.0 final and RemotingLite v.1.2.3 released

After weeks of writing, rewriting and testing the code for the Message Passing API (MPAPI) it is finally finished.

MPAPI is a framework that enables programmers to write concurrent, parallel and/or distributed software systems – in essence building cluster computers. I started writing it for a couple of reasons:

  • My research into genetic programming (GP) was stalling a bit due to limited computing resources. Since I have a few computers around the house I wanted to enlist them in the huge computations that are necessary in GP, and I wanted to write a framework for building such distributed systems.
  • For years I have written multithreaded (concurrent, parallel) software using the normal constructs for that in C++, Java and C#. Time and again I have debugged such applications, and I have yet to see a multithreaded program that is bugfree. It is simply too complex to write such applications using the normal synchronization mechanisms in languages with shared state concurrency. After writing a bit of Erlang code I was profoundly pleased with the way that language handles concurrency, and the ideas I have learned from that language has been incorporated into MPAPI. (more…)

Powered by WordPress