Microsoft's .NET team has introduced a new 64-bit just-in-time (JIT) compiler code-named RyuJIT.
In a recent blog post, Andrew Pardoe, PM manager for the Common Language Runtime (CLR) PM team, said Microsoft's existing 64-bit JIT compiler is fast, but may not be fast enough for some uses.
"The world is moving to 64-bit computing even though it isn't always faster or more efficient than 32-bit," Pardoe said. "A lot of programs run faster on 32-bit than on 64-bit, for a variety of reasons. One example of this is the 64-bit JIT compiler in .NET. It does a great job of making your program run fast, but it's not a fast program itself. All that's about to change: a new, next-generation x64 JIT compiler that compiles code twice as fast is ready to change your impressions of 64-bit .NET code."
Pardoe explained that the .NET 64-bit JIT was originally designed to produce very efficient code throughout the long run of a server process. "This differs from the .NET x86 JIT, which was optimized to produce code quickly so that the program starts up fast", he said. "Taking time to compile efficient code made sense when 64-bit was primarily for server code. But 'server code' today includes web apps that have to start fast. The 64-bit JIT currently in .NET isn't always fast to compile your code, meaning you have to rely on other technologies such as NGen or background JIT to achieve fast program startup."
Thus, Microsoft's .NET Code Generation team has been working on RyuJIT, a next-generation x64 compiler. This new JIT is twice as fast, meaning apps compiled with RyuJIT start up to 30 percent faster. Moreover, the new JIT still produces great code that runs efficiently throughout the long run of a server process.
Although the performance enhancements with RyuJIT are obvious, Pardoe says this is only the start and that the best is yet to come.
"The performance gains and working set reductions of RyuJIT are fantastic, but they're not the best part of RyuJIT," he said. "When JIT64 was developed, we decided to base it off of the C++ team's optimizing compiler instead of basing it off of the existing 32-bit x86 JIT, which is more optimized for dynamic compilation scenarios. Most 64-bit computers were being used as servers so it made sense to emphasize compiled code quality over compiler throughput. But this left the .NET CodeGen team with two compiler codebases to maintain. Adding features (and fixing bugs!) in two places slowed down the pace of innovation. Adding the ARM architecture and MDIL for Windows Phone 8.0 in recent years made it even harder to keep up."
RyuJIT is based off of the same codebase as the x86 JIT, Pardoe said. "While it's only for x64 right now, it's a modern compiler that will be the basis of all our JIT compilers in the future: x86, ARM, MDIL and whatever else comes along," he added. "Having a single codebase means that .NET programs are more consistent between architectures—put another way, you generally get bug-for-bug compatibility. But having a single codebase also means we can innovate faster and bring you more code generation features more quickly."
RyuJIT is currently available as a Community Technology Preview (CTP) that developers can try in their non-production environment. The RyuJIT installer can be downloaded now. RyuJIT is not supported for production code right now, but Microsoft wants to get feedback on it, particularly any issues, bugs or behavioral differences that developers encounter. Developers are encouraged to send feedback and questions to email@example.com.
RyuJIT only works on 64-bit editions of Windows 8.1 or Windows Server 2012 R2.