[Mono-list] Using the Microsoft class libraries with the Mono CLR

Jonathan Pryor jonpryor@vt.edu
Tue, 19 Oct 2004 06:50:03 -0400


On Tue, 2004-10-19 at 04:19, Evan Clarke wrote:
> I have narrowed it down to comparing the performance of some of the
> standard class libraries as implemented by both Mono and Microsoft.  The
> only fair way to benchmark these would be in the same environment, and
> using the same CLR to remove the possibility of one JIT-er being better
> than the other - as this is outside the intended testing scope.
> 
> Ideally I would like to run both the Mono and Microsoft standard class
> libraries using mono under the Linux environment.  Is this even possible
> - or is there plenty of P/Invoking going on in there?

It depends on the assembly.  Assuming you want to test mscorlib.dll and
System.dll, then you're out of luck.  Mscorlib.dll, in particular, has a
large number of "internal calls" (like P/Invoke, but into the runtime,
not into an arbitrary library); as such, mscorlib.dll is tied to a
single CLR implementation, and can't be used in another (unless the CLR
implementations agree on their internal calls, but this is unlikely).

System.dll and other assemblies also make use of internal calls, so
they're not portable.  However, if you only use types which *don't* use
internal calls, you should be safe, but it's not easy to tell which
types use internal calls...  (Use monodis and grep for "internalcall".)

 - Jon