File size

File size

File size

File size

File size

1.1 GB

By now you've learned that the CLR, Windows Phone Client, and Windows Phone Services teams got together to develop "Compiler in the Cloud". All Windows Phone 8 apps written in .NET technologies will get the benefit of this collaboration. The end goal? Really fast startup of Windows Phone 8 .NET apps.

"Compiler in the Cloud?", you ask.

The idea is pretty simple. First, enter MDIL or Machine Dependent Intermediate Language or .NET hybrid assembly language. MDIL is all about compiling to native assembly instructions whenever possible, and compile the rest to pseudo instructions that can quickly be translated to native instructions on the phone. Thus, this assembly containing a mix of pseudo instructions and native instructions can be shipped to the device (and is portable across the same architecture - example, across all the ARM devices), and on the device we perform a light-weight linking step to convert the entire assembly to a native image. Most of the heavy lifting is done when we compile the IL assembly to the intermediate file between an IL assembly and a native image (this is what MDIL is).

"So what?", you ask. The linking step on the device that converts MDIL assembly to a native image only takes 1/5th the time as traditional NGEN on device. Thus, we get some of the benefits of both pre-compilation (since we are executing off the native image where all instructions are assembly instructions) and JIT-compilation (no heavy compilation on the device during framework updates).

Tune in to meet the program manager for code generation in .NET, Subramanian (Mani) Ramaswamy, and one of the lead developers of "Compiler in the Cloud", Peter Sollich. Peter is an expert in precompilation. We go quite deep here with plenty of whiteboarding. Peter teaches us exactly what MDIL is and why it's designed the way it is. We also talk about the higher level meaning in this (apps start fast, at native speed!). All around, it's a great Going Deep episode. Take the time to watch and learn. Thanks Mani and Peter!!

See Subramanian's BUILD 2012 session where he goes into detail on MDIL/Compiler in the Cloud and other performance/functionality improvement in .NET for Windows Phone 8.

Any idea why the CLR team came up with Auto NGEN for the desktop instead ? I think this should be the way forward atleast for the .Net WinRT( Metro) apps. IIRC auto ngen is done using a on device maintenance task , so though the subsequent startups may be faster the initial startup would always be slower.

Great technology. It will be very interesting to hear about phase two, when it arrives, which is the improved optimization in the cloud. It's also cool to think about application updates arriving automatically without the interaction of the developer because an improved compiler yields improved performance. So the end user could see messages like "applications updated with improved performance". That must be a pretty motivating thought for the team.

Remove this comment

Remove this thread

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums, or
Contact Us and let us know.