Microsoft Speeds Up Windows Store Apps with .NET Native

| by Abel Avram Follow 4 Followers on Apr 03, 2014. Estimated reading time: 2 minutes |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

.NET Native is an attempt from Microsoft to reduce the start up times and memory footprint of Windows Store applications.

Speculation about this project started to circulate in November last year when some noticed that a certain Windows Store app had a much faster start up time. Known internally as Project N, .NET Native improves the performance of .NET applications by precompiling managed code into native one using the Microsoft’s C++ back-end infrastructure. This technology is different from NGen (Native Image Generator) or dynamic compilation for Store apps.

The .NET Native toolchain initially generates MSIL which is then processed by the C++ optimizer generating MDIL (Machine-Dependent IL), according to Mani Ramaswamy, Project Manager of the .NET Native team, who provided technical details in a Channel 9 interview. The native app is statically linked against Mrt100.dll which is just a few hundred KB in size, according to Shawn Farkas, Dev Lead. Mrt100.dll represents a minimum CLR, refactored and optimized for static compilation. So, when the application starts up it runs against this minimal CLR without loading the entire .NET runtime, without involving any JIT compilation.

Applications can still use dynamic to access objects whose type is decided at run time. This is made possible by discovering during code optimization and keeping all the possible types that might be accessed at run time, said Ramaswamy. Also, the standard background garbage collection is used.

These optimizations have increased the start up time up to 60%, while the memory footprint has been lowered by 15%, according to Ramaswamy. .NET Native is currently a preview and is targeted at Windows Store apps, but the team intends to extend it to the general desktop .NET apps.

Not much changes for the .NET developer. There are no machine abstractions introduced at the application level, and the entire developing-debugging experience remains the same. What changes is the build. One needs to generate separate builds for specific hardware platforms, of which two are already supported - ARM, x86-64bit –, while support for the x86-32bit is to come soon. One should expect 1-2 minutes longer build times due to optimizations.

Not everything works right now. MSDN has a section for Compiling Apps with .NET Native, including a page on migrating apps to .NET Native. There are some differences in the runtime, dealing with dynamic programming and reflection, a number of unsupported scenarios and APIs, and differences in working with Visual Studio.

To enable native code one needs Visual Studio 2013 Update 2 RC and the .NET Native SDK.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Visual Basic 6 compiler by S Ten

.Net Native, or anything that speeds up .Net, is sorely needed.
Pre-compiling, rather than JIT compiling, will speed up loading time, though not necessarily performance.
Of course, the backend compiler for this is the C++ compiler - just like the VB6 programming language has used since 1998 !

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you