Book Image

ASP.NET Core 2 High Performance - Second Edition

By : James Singleton
Book Image

ASP.NET Core 2 High Performance - Second Edition

By: James Singleton

Overview of this book

The ASP.NET Core 2 framework is used to develop high-performance and cross-platform web applications. It is built on .NET Core 2 and includes significantly more framework APIs than version 1. This book addresses high-level performance improvement techniques. It starts by showing you how to locate and measure problems and then shows you how to solve some of the most common ones. Next, it shows you how to get started with ASP.NET Core 2 on Windows, Mac, Linux, and with Docker containers. The book illustrates what problems can occur as latency increases when deploying to a cloud infrastructure. It also shows you how to optimize C# code and choose the best data structures for the job. It covers new features in C# 6 and 7, along with parallel programming and distributed architectures. By the end of this book, you will be fixing latency issues and optimizing performance problems, but you will also know how this affects the complexity and maintenance of your application. Finally, we will explore a few highly advanced techniques for further optimization.
Table of Contents (20 chapters)
Title Page
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
3
Setting Up Your Environment
4
Measuring Performance Bottlenecks

Chapter 1. What's New in ASP.NET Core 2?

There are many things that have changed in version 2 of the ASP.NET Coreframework. There have been a lot of improvements in some of its supporting technologies as well. Now is a great time to give it a try, as its code has been stabilized and the pace of change has settled down a bit.

There were significant differences between the original release candidate and version 1 of ASP.NET Core and further alterations between version 1 and version 2. Some of these changes have been controversial, particularly ones related to tooling; however, the scope of .NET Core has grown massively, and this is a good thing.

One of the high-profile differences between version 1 and version 2 is the change (some would say regression) from the new JavaScript Object Notation (JSON)-based project format back to the Extensible Markup Language (XML)-based csproj format. However, it is a simplified and stripped-down version, compared to the format used in the original .NET Framework.

There has been a move toward standardization between the different .NET Frameworks, and .NET Core 2 has a much larger API surface as a result. The interface specification, known as .NET Standard 2, covers the intersection between .NET Core, the .NET Framework, and Xamarin. There is also an effort to standardize Extensible Application Markup Language (XAML) into the XAML standard, which will work across Universal Windows Platform (UWP) and Xamarin.Forms apps.

C# and .NET can be used on a huge range of diverse platforms and in a large number of different use cases, from server-side web applications to mobile apps and even games (using game engines such as Unity 3D). In this book, we'll focus on web application programming and, in particular, on general ways to make web apps perform well. This means that we will also cover client-side web browser scripting with JavaScript and the performance implications involved.

This book is not just about C# and ASP.NET. It takes a holistic approach to performance and aims to educate you about a wide range of relevant topics. We don't have the space to take a deep dive into everything, so the idea here is to help you discover some useful tools, technologies, and techniques.

In this chapter, we will go through the changes between version 1 and version 2 of both .NET Core and ASP.NET Core. We will also look at some new features of the C# language. There have been many useful additions and a plethora of performance improvements too.

In this chapter, we will cover the following topics:

  • What's new in .NET Core 2.0
  • What's new in ASP.NET Core 2.0
  • Performance improvements
  • .NET Standard 2.0
  • New C# 6.0 features
  • New C# 7.0 features
  • JavaScript considerations