.NET vs Mono performance

  • Thread starter Thread starter Jon Harrop
  • Start date Start date
J

Jon Harrop

I've just done some quick performance tests using various medium-sized
benchmarks and it appears that .NET is vastly faster than Mono. Can anyone
confirm this?

For example, my ray tracer benchmark from the shootout (in C#):

32-bit .NET: 13s
64-bit Mono: 123s

I was expecting Mono to be maybe 2x slower but 10x is very disappointing.
 
Jon Harrop said:
I've just done some quick performance tests using various medium-sized
benchmarks and it appears that .NET is vastly faster than Mono. Can anyone
confirm this?

For example, my ray tracer benchmark from the shootout (in C#):

32-bit .NET: 13s
64-bit Mono: 123s

I was expecting Mono to be maybe 2x slower but 10x is very disappointing.

I think it would be worth doing performance tests on more similar
equipment - tests on different architectures aren't very easily
comparable.

Also bear in mind that your bottleneck may be something that the Mono
JIT does particularly badly - it's effectively impossible to get a
"general" benchmark, as every application will have slightly different
bottlenecks.

Having said all that, I agree it's disappointing.
 
Jon said:
I think it would be worth doing performance tests on more similar
equipment - tests on different architectures aren't very easily
comparable.

These are identical machines:

2x 4400+ AMD64 (2.2GHz)
2Gb RAM
GF7900GT

The only difference is the software (64-bit Linux, 32-bit Windows). If
anything I'd expect 64-bit to give the advantage to Mono.
Also bear in mind that your bottleneck may be something that the Mono
JIT does particularly badly - it's effectively impossible to get a
"general" benchmark, as every application will have slightly different
bottlenecks.

Yes. Any idea what the problem might be? Perhaps Mono is swamped by 64-bit
pointers, but that would only explain another factor of 2.
 
Jon said:
The only difference is the software (64-bit Linux, 32-bit Windows). If
anything I'd expect 64-bit to give the advantage to Mono.

I'd actually expect the opposite, due to reduced effective cache size
because of larger pointers and less maturity in compilation experience &
effort.

-- Barry
 
Barry said:
I'd actually expect the opposite, due to reduced effective cache size
because of larger pointers and less maturity in compilation experience &
effort.

I've only ever seen one benchmark get worse going from 32- to 64-bit and it
was an allocation intensive tree-based algorithm. In general, 64-bit is
much faster, particularly for FP intensive work like this ray tracer.
 
Jon said:
I've only ever seen one benchmark get worse going from 32- to 64-bit

Specifically using the Mono JIT compiler? Not all compilers are created
equal by dint of targeting the same architecture, alas.
and it
was an allocation intensive tree-based algorithm. In general, 64-bit is
much faster, particularly for FP intensive work like this ray tracer.

I think you need to isolate your variables and test Mono on Win32.

FP on x64 is completely different from x86 - specifically x87 isn't
there, there's no FP stack etc. FP codegen needs a rewrite for x64.
Perhaps it hasn't been paid due attention yet for Mono/x64?

-- Barry
 
Why not test windows mono against .net on same machine and OS? At least
that way, you eliminate the 32/64 issue and the OS issue and can get closer
to apples-to-apples tests on library perf.

--
William Stacey [C# MVP]


|
| I've just done some quick performance tests using various medium-sized
| benchmarks and it appears that .NET is vastly faster than Mono. Can anyone
| confirm this?
|
| For example, my ray tracer benchmark from the shootout (in C#):
|
| 32-bit .NET: 13s
| 64-bit Mono: 123s
|
| I was expecting Mono to be maybe 2x slower but 10x is very disappointing.
|
| --
| Dr Jon D Harrop, Flying Frog Consultancy
| OCaml for Scientists
|
http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet
 
Barry said:
Specifically using the Mono JIT compiler?

No, that was OCaml (which is more pointer-intensive than most languages).
Not all compilers are created equal by dint of targeting the same
architecture, alas.
True.

I think you need to isolate your variables and test Mono on Win32.

FP on x64 is completely different from x86 - specifically x87 isn't
there, there's no FP stack etc. FP codegen needs a rewrite for x64.
Perhaps it hasn't been paid due attention yet for Mono/x64?

Yes, that's a very good point. I hadn't thought of it like that. Actually, I
didn't even know you could get Mono for Windows.

However, I'm really interested in .NET on Windows vs whatever on Linux and,
currently, I think that "whatever" has to be Mono.
 
Back
Top