[Mono-ue] Overhead of Mono for Unreal Engine

Miguel de Icaza miguel at xamarin.com
Sat Oct 25 14:14:53 UTC 2014


Hello Brad,

We have not done any benchmarking, we have been focused on the integration,
API design, GC integration, and developer experience.   We are likely going
to keep doing that (and filling some of the gaps identified in the roadmap).

I hope that community members that got the code to the benchmarking, and
then decide if this is worth it or not for them.

There is overhead in bringing the Mono runtime (from memory, these should
be about 2-4 megs of disk space, and around 1-2 megs of memory consumption
to startup).   Then, you pay as you go (more .NET features or third-party
libraries you use, the bigger the binary, the more the memory used).

For performance, the question is trickier, it depends on the compilation
mode.   Our FAQ now has been updated to reflect this information for
newcomers to Mono.

Eventually we want to support all Mono compilation modes, which means, you
could use LLVM's optimizing compiler everywhere and that should get you
pretty close to C++ performance [1].   That is the kind of thing that
prevents this project from being a product - we just have not finished
crossing all the t's.

There is also the overhead of switching from the managed world to the
unmanaged world.   That cost depends on what kind of method you are
invoking, and whether you are doing any marshaling, or whether you are
passing pointers.   This should be about 20 instructions per transition, a
little heavier than a raw call across interop boundaries in C to C.

But we have not measured those, and would love if someone does that.
Meanwhile, we will be polishing the rest ;-)

[1] I say pretty close and not exactly close, because C# enforces
arrays-bounds-checking, so as long as you use regular C# arrays, you will
always have a performance penalty for those.    You *can* use unsafe memory
access and work around that, but then, you would be writing unsafe code.

On Sat, Oct 25, 2014 at 12:46 AM, Brad Moore <brad.stephen.moore at gmail.com>
wrote:

> Hey,
> Just wondering if there would be any (and if so, how much) overhead
> running Mono for UE vs using C++.
> Any stats, benchmarks or pretty graphs to have a look at or is that
> something we'd have to generate that info ourselves?
>
> - BradM
>
> _______________________________________________
> Mono-ue mailing list
> Mono-ue at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-ue
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-ue/attachments/20141025/be9ed1ea/attachment.html>


More information about the Mono-ue mailing list