Miguel de Icaza has a blog entry where he describes the new SIMD support in Mono. He has ported to C# a C++ application, to illustrate the new SIMD stuff, and then he compares the results, the C++ program was rather slow. I had a look at the source code an I've seen that the C++ program was compiled in debug mode.
I've decided to make a few tests for myself. I've used MinGW 4.3.2 and Visual Studio 2005, the tests where run on my Intel Mobile Core 2 Duo T7500.
Here are the results (in seconds):
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOCNADdRt25NnSFq32ALzlryet2YEoeEQR9BfPqYD77iSqs6cU-cQBNWQj4rfTXh0CgqSVua6E4tROH6sb4TCsrjvwlJ20aeQPls94dI4pzZkY5RzwTTB7NBlFzw1MjHy1UV5P/s400/results.png)
The parameters for the above results were:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFrN3ZXDGnyuRvWa7EFR8RZRp5UA1tZ5SnyfXn3AByXK1Ld8Bu5_jSFsNJVHo7_GCbVFndbIhjltYY2_a651rDNnsCb0MvMrPiM7LiE8HNyGljUYfYk8_5YdIu_LdfA8gVBsV/s400/runtime.png)
Mono is not quite there yet (at least on Windows).
I had to change the timing code for the C++ code, glib::GTimer is not a very good option on Windows. I've used the high-resolution performance counter, the code is presented below:
#ifndef PERFTIMER_H
#define PERFTIMER_H
#include <windows.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
class PerfTimer
{
LARGE_INTEGER start_;
LARGE_INTEGER stop_;
LARGE_INTEGER freq_;
public:
PerfTimer()
{
QueryPerformanceFrequency(&freq_);
}
void Start()
{
QueryPerformanceCounter(&start_);
}
void Stop()
{
QueryPerformanceCounter(&stop_);
}
std::string ToString()
{
const int precision = 10000000;
unsigned long time = static_cast<unsigned long>(
(stop_.QuadPart - start_.QuadPart) * precision /
freq_.QuadPart);
std::ostringstream os;
os << std::setfill('0');
os << std::setw(2) << time / precision / 3600 << ":";
os << std::setw(2) << time / precision % 3600 / 60 << ":";
os << std::setw(2) << time / precision % 60 << ".";
os << std::setw(7) << time % precision;
os << std::setfill(' ');
return os.str();
}
};
#if 0
int main()
{
PerfTimer timer;
timer.Start();
Sleep(1250);
timer.Stop();
std::cout << "Time: " << timer.ToString() << std::endl;
return 0;
}
#endif
#endif // PERFTIMER_H
There are a few things I would like to point out about the Mono 2.2 Windows installer.
1. The executable is not digitally signed by Novell.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-1ELXI2iJGB2lwZChuoaPIYzY-XZJFI5WZ0CREgL8Bp_Z0UC-NfYCukzroXnPCqu9SXJDc45RWaaxeKVcqUzx-dZUvhO6RIHHJsj379jedudCFUd-JzZvLuZf9alGWVLmZ4GQ/s400/mono1.png)
2. The graphics are hideous, 16 colors dithering? why? Is anybody in their right mind running Windows in 16 colors?
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtAuiw29LFHMIvBDKCa5TykWdkQzBvD6sVUql3YktL1ne-gKdd3BSaI5-2AWfzx_KoePx2l0QXAH6r1v3vqYT2AIuI_FZqy7Im51OBSp-JQqgD8Kyw7Gc56G9C96eKTmY1modw/s400/mono3.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1XXrmkWjlLplLqa8wwom_kcFPC0ZcKAcyNY7FUu4vePoX4rHQ-32Dx7rCBEdmRH84rIcNm0GbgNhGqTF9aCdzz8OYPp5ywfS5S-hrh6sSLfzKGuweNO37mfMGJxvJ-bEiIU9z/s400/mono2.png)