With the release of NET Core, the acquisition of Xamarin and Mono, and the 15 or so years of development of the NET Framework, we now have three platforms to choose from for C#. Why are there three platforms? What are the differences between each? And, what is the performance of the three to each other? From the NET Core Roadmap, it’s clear that Microsoft is trying to focus on OS-agnostic implementations of NET.
NET Framework is for Windows desktop and mobile applications. The NET Framework is specific for Windows because it has Windows UI functionality. If you want an application that works across different OSes, then this won’t be your choice.
NET Core is for console and server applications that need to work on any OS. Also, a focus of the NET Core framework is small size/efficient applications. The first release was only a month ago, and there are many things missing. If you need UI beyond System.Console, look to one of the other two platforms.
Finally, Mono/Xamarin is for mobile applications. Mono can also run NET Framework console applications on most OSes without changes. On Android, C# and Java can call each other. If you have a large Java code base, this is a good choice. Xamarin Forms is an OS-independent UI for mobile devices.
What are the differences in performance between NET Framework, NET Core, and Mono? The following test computes the performance of a recursive implementation of Ackermann’s function and a looping implementation of a Fibonacci function. If you are looking for performance of in a console application, NET Core is your choice.
Runtimes based on sample size of 10, .NET Core 1.0.1, .NET Framework 4.5, Mono JIT compiler version 4.2.2 (Visual Studio built mono), Windows 10 Anniversary Update, Intel(R) Core(TM) i5-3570K CPU @ 3.40GH, Northbridge Intel Ivy Bridge rev. 09, Southbridge Intel Z77 rev. 04, Graphic Interface PCI-Express, PCI-E Link Width x16, PCI-E Max Link Width x16, Memory Type DDR3, Memory Size 16 GBytes, Channels Dual, Memory Frequency 800.7 MHz (1:6), CAS# latency (CL) 11.0, RAS# to CAS# delay (tRCD) 11, RAS#, Precharge (tRP) 11, Cycle Time (tRAS) 28, Command Rate (CR) 2T, Host Bridge 0x0150.
On Ubuntu, there is a similar speedup for Ackermann’s function with NET Core. But for the Fibonacci function, surprisingly slightly slower with NET Core compared to the Mono implementation.
Runtimes based on sample size of 3, .NET Core 1.0.1, .NET Framework 4.5, Mono JIT compiler version 4.4.2 (Stable 22.214.171.124/f72fe45 Fri Jul 29 09:58:49 UTC 2016); Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz; 512 MB Memory / 20 GB Disk / SFO2 – Ubuntu 16.04.1 x64.
.NET Core 1.0, .NET Framework, Xamarin – The “WHAT and WHEN to use it”. Accessed August 10, 2016.
Microsoft reveals big plans for .Net Core. Accessed August 10, 2016.
.NET Core. Accessed August 10, 2016.
.NET Core Roadmap. Accessed August 10, 2016.
.NET Core Version 1 Released – So What? Accessed August 10, 2016.
Getting Started with ASP.Net Core Accessed August 10, 2016.