BT

.NET Core 2.1 Delivers Improved Performance and Deployment Options

| by Jeff Martin Follow 16 Followers on May 31, 2018. Estimated reading time: 2 minutes |

Microsoft has officially released .NET Core 2.1 for all platforms. This release is intended to receive long term support, but according to Microsoft's Rich Lander, is not yet officially designated LTS. Lander says a small but significant number of updates will be added to this release before it is considered complete. Once it is official, this release will be supported as LTS for three years. For all .NET Core applications under active development, Lander says programmers should proceed to switching to 2.1 right now.

What will the switch to 2.1 provide? Beyond the soon to arrive LTS designation, 2.1 brings support for Ubuntu 18.04, Alpine Linux, and ARM32. It also adds self-contained application publishing and improved performance.

When looking at the performance gains, it should be noted that these represent a speed increase of 2.1 over .NET Core 2.0 in incremental build-time performance. Joining this is a brand new class, SocketsHttpHandler, which is a C# implementation of HttpClient. SocketsHttpHandler is much faster than previous implementations and provides consistent cross-platform behavior.

Microsoft's Stephen Toub describes in great detail the runtime performance improvements in 2.1. Some of these improvements come from the addition of System.Span<T> and related types. Other changes were made to the Just-In-Time (JIT) compiler used in .NET Core 2.1.  An interesting addition is the ability to take advantage of tiered compilation. In this scenario, the JIT compiler generates executable as fast as possible with minimal optimizations. After this is completed, the JIT compiler will observe program operation, and heavily used methods will receive a second more optimized compilation pass. The theory is, why take time to optimize methods that may not be heavily used, if at all? This behavior is not activated by default, but can be activated with the following environment variable:

COMPlus_TieredCompilation="1"

Performance gains are not limited to code optimizations; the .NET Core team has also incorporated a new compression standard to reduce the size of data transmissions.  Using an implementation based on C code from Google, Microsoft has added support for Brotli Compression to .NET Core 2.1.  As Brotli is widely supported across many web browsers and web servers, it is helpful for this technology to be available and supported on .NET Core.

Finally .NET Core 2.1 provides support for self-contained deployments (SCD). This is the ability to generate a Release build of your application that includes all of the .NET Core runtime files needed to execute. While this takes up more disk space than a regular build, it provides developers with the control to specify what platforms the application will run and which version of .NET Core is used.

Full release notes for .NET Core 2.1 as well downloads for all supported platforms (Windows, macOS, and Linux) are available now.

Rate this Article

Adoption Stage
Style

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
Community comments

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

Discuss

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


Recover your password...

Follow

Follow your favorite topics and editors

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

Like

More signal, less noise

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

Notifications

Stay up-to-date

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

BT