In New Releases, Microsoft Lauds .NET Productivity, Visual Studio 2019 Speed
Microsoft is continuing to crow about .NET productivity and speed gains in Visual Studio 2019 following last week's mass shipments of .NET 5, Visual Studio 2019 v16.8 and more.
"The improvements are massive and will greatly improve our iteration times," the company quoted The Coalition's Aurel Cordonnier as saying of Visual Studio speed gains observed in testing by the game-maker.
The Coalition, which produces the popular game Gears 5, tested the compile and link times in three different versions of Visual Studio.
"The experiment was conducted to measure not only overall end-to-end time improvements but also link time improvements in the preview compared to the current release," Microsoft said in a Nov. 16 blog post from the C++ team. "Using Visual Studio 2019, the team saw 2.67x faster end-to-end build times and 27.9x faster link times compared to Visual Studio 2017."
The post goes into detail about the testing's methodology and results, noting that the Gears 5 dev team didn't conduct it with the idea of moving the game's development to the latest iteration of Microsoft's flagship IDE. Generally, big game-makers that eek out the best possible performance in finely tuned, close-to-the-metal C++ code probably aren't likely to introduce too many radical changes in existing projects.
"So, we're not actually moving Gears 5 to 2019," Cordonnier said. "We did the work to get Visual Studio 2019 going on PC for the purpose of comparing build times and providing feedback. Gears 5 shipped over a year ago and the game has been very carefully tuned; therefore, we don't want to take the risk of changing the toolchain as we have limited testing capacity and very slight optimization changes could change the balance of the game in very subtle ways. In addition, the XDK does not support 2019 so we would need to support two toolchains which is something we don't have the capacity for.
"The results of the experiment reinforced our desire to stay current with new versions of Visual Studio for our future projects."
As a result of the testing, though, an unannounced future project will be done on VS 2019, Cordonnier said.
Meanwhile, the .NET Productivity team penned its own post about productivity enhancements, powered by the .NET Compiler Platform called "Roslyn."
We've seen a lot of excitement in the past few months over our latest features which automate and reduce editing tasks to a single click and help save you time," said Mika Dumont, program manager, .NET and Visual Studio team.
She focused on two areas -- tooling and code fixes/refactorings -- and provided highlights summarized below:
Roslyn analyzers now come with the .NET SDK and are enabled by default for projects that target .NET 5.0 or later.
- Inline parameter name hints, another new feature, inserts adornments for literals, casted literals and object instantiations before each argument in function calls. Furthermore, the first preview of the next Visual Studio iteration, v16.9, includes inline type hints for variables with inferred types and lambda parameter types.
- Developers can now extract members from a selected class to a new base class with the new extract base class refactoring.
- Code cleanup sports new configuration options to apply formatting and file header preferences set in an EditorConfig file across a single file or an entire solution.
Code Fixes/Refactorings (via lightbulb or screwdriver icons):
- Developers can replace usages of a static, instance and extension method within a single statement body with an option to remove the original method declaration, all via the new The inline method refactoring.
- "The use pattern matching refactoring introduces the new C# 9 pattern combinators. Along with the pattern matching suggestions, such as converting
== to use
is where applicable, this code fix also suggests the pattern combinators and, or and not when matching multiple different patterns and negating."
- Another refactoring, make class abstract, quickly solves the problem of making a class abstract when trying to write an abstract method in a non-abstract class.
- "The convert typeof to nameof refactoring allows you to easily convert instances of typeof(<QualifiedType>).Name to nameof(<QualifiedType>) in C# and instances of GetType(<QualifiedType>).Name to NameOf(<QualifiedType>) in Visual Basic. Using nameof instead of the name of the type avoids the reflections involved when retrieving an object."
Much more detail on all of the above is presented in the post, and more information canbe found in the Visual Studio release notes.
This week's speed/productivity posts follow others that tout the benefits of Microsoft's new wares, such as one we covered last week in this article: "Blazor and ASP.NET Core Get Faster in .NET 5."
David Ramel is an editor and writer for Converge360.