Aggressive Inlining in the CLR 4.5 JIT

Friday, January 20, 2012

Inlining is an important optimization that allows compilers to eliminate the cost of method calls in situations where the method call overhead is more significant than the method body itself. The CLR JIT uses inlining conservatively, but features some nice tricks such as interface method call inlining – this was one of the first things I covered on this blog, almost five years ago. The limitations on JIT inlining are not known precisely, but some criteria have been announced previously (in 2004!). Namely, the JIT won’t inline: Methods marked with MethodImplOptions.NoInlining ...
3 comments

SDP December 2011: What’s New in .NET 4.5 Keynote

Tuesday, December 13, 2011

Noam and I delivered a joint keynote at the first day of the SDP, covering the new APIs and internal features of .NET 4.5. With my love for internals, I took the easy route of talking about CLR internals and C# 5 async methods, and Noam talked about WCF, Entity Framework, WPF, ASP.NET MVC, and plenty of other frameworks which have been updated in .NET 4.5. As you probably know, .NET 4.5 is an in-place update for .NET 4.0, which means—as far as Microsoft is concerned—that it should work seamlessly where .NET 4.0 does, with full...
no comments

SELA Developer Practice: December 2011

Sunday, October 30, 2011

I’m interrupting our scheduled programming for an important announcement: we will be hosting the SELA Developer Practice at the Crown Plaza hotel (Tel Aviv) and the SELA headquarters on December 4-8, 2011! The format is (again) slightly different—we will be having a day full of keynote sessions on Windows 8 and other //build announcements, including Visual Studio 11 and .NET Framework 4.5. Then, we will host 22 full-day tutorials on a wide variety of topics—old and new—parallel programming, Windows 8 development, TFS, Windows Phone Mango, HTML 5, .NET debugging, and many others. The speakers are...
no comments

Capture, Transfer, and Rethrow Exceptions with ExceptionDispatchInfo [.NET 4.5]

Wednesday, October 19, 2011

.NET 4.5 has a little hidden gem up its sleeve – the ExceptionDispatchInfo class. It’s used by the Task Parallel Library to capture and rethrow exceptions when they are not aggregated – specifically, to support the await keyword. Luckily, the class is public and can be used by anyone to capture an exception that occurred in one context – say, a thread – and then rethrow it (selectively) in another context – say, on another thread, while maintaining the full fidelity of the original stack trace and exception information. First, let’s take a look at a stack trace...
one comment