C# 7 and .NET Core 2.0 High Performance
eBook - ePub

C# 7 and .NET Core 2.0 High Performance

Ovais Mehboob Ahmed Khan

Share book
  1. 300 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

C# 7 and .NET Core 2.0 High Performance

Ovais Mehboob Ahmed Khan

Book details
Book preview
Table of contents
Citations

About This Book

Improve the speed of your code and optimize the performance of your apps

Key Features

  • Understand the common performance pitfalls and improve your application's performance
  • Get to grips with multi-threaded and asynchronous programming in C#
  • Develop highly performant applications on.NET Core using microservice architecture

Book Description

While writing an application, performance is paramount. Performance tuning for realworld applications often involves activities geared toward fnding bottlenecks; however, this cannot solve the dreaded problem of slower code. If you want to improve the speed of your code and optimize an application's performance, then this book is for you. C# 7 and.NET Core 2.0 High Performance begins with an introduction to the new features of what?explaining how they help in improving an application's performance. Learn to identify the bottlenecks in writing programs and highlight common performance pitfalls, and learn strategies to detect and resolve these issues early. You will explore multithreading and asynchronous programming with.NET Core and learn the importance and effcient use of data structures. This is followed with memory management techniques and design guidelines to increase an application's performance. Gradually, the book will show you the importance of microservices architecture for building highly performant applications and implementing resiliency and security in.NET Core. After reading this book, you will learn how to structure and build scalable, optimized, and robust applications in C#7 and.NET.

What you will learn

  • Measure application performance using BenchmarkDotNet
  • Explore the techniques to write multithreaded applications
  • Leverage TPL and PLinq libraries to perform asynchronous operations
  • Get familiar with data structures to write optimized code
  • Understand design techniques to increase your application's performance
  • Learn about memory management techniques in.NET Core
  • Develop a containerized application based on microservices architecture
  • Learn tools and techniques to monitor application performance

Who this book is for

This book is for.NET developers looking at improving the speed of their code or simply wanting to take their skills to the next level. Basic C# knowledge is assumed.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is C# 7 and .NET Core 2.0 High Performance an online PDF/ePUB?
Yes, you can access C# 7 and .NET Core 2.0 High Performance by Ovais Mehboob Ahmed Khan in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación en C++. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788474603

What's New in .NET Core 2 and C# 7?

.NET Core is a development platform by Microsoft that runs cross-platform and is maintained by Microsoft and the community at GitHub. It is the most emergent and popular framework in development communities due to its performance and platform portability. It targets every developer that can develop any application for any platform that includes web, cloud, mobile, embedded, and IoT scenarios.
With .NET Core, we can develop applications using C#, F#, and now VB.NET as well. However, C# is the most widely used language among developers.
In this chapter, you will learn the following topics:
  • Performance improvements in .NET Core 2.0
  • Upgrading the path from .NET Core 1.x to 2.0
  • .NET Standard 2.0
  • What comes with ASP.NET Core 2.0
  • New features in C# 7.0

Evolution of .NET

In early 2002, when Microsoft first introduced the .NET Framework, it targeted developers who were working on classic ASP or VB 6 platforms since they didn't have any compelling framework for developing enterprise-level applications. With the release of the .NET Framework, developers had a platform to develop applications and could choose any of the languages from VB.NET, C#, and F#. Irrespective of the language chosen, the code is interoperable, and developers can create a project with VB.NET and reference it in their C# or F# project and vice versa.
The core component of .NET Framework includes Common Language Runtime (CLR), Framework Class Libraries (FCL), Base Class Libraries (BCL), and a set of application models. New features and patches have been introduced with the newer version of the .NET Framework, which comes with the new release of Windows, and developers have had to wait for a year or so to get those improvements. Every team at Microsoft worked on a different application model, and each team had to wait for the date when the new framework was released to port their fixes and improvements. Windows Forms and Web Forms were the primary application models at that time that were widely used by .NET developers.
When Web Forms was first introduced, it was a breakthrough which attracted both web developers who worked on Classic ASP and desktop application developers who worked on Visual Basic 6.0. The developer experience was appealing and provided a decent set of controls that could easily be dragged and dropped to the screen, followed to their events and properties that could be set either through the view file (.aspx) or code-behind files. Later on, Microsoft introduced the Model View Controller (MVC) application model that implemented the separation of concerns design principle, so that View, Model, and Controller are separate entities. The View is the user interface that renders the Model, where the Model represents the business entity and holds the data, and the Controller that handles the request and updates the model and injects it into the View. MVC was a breakthrough that let developers write cleaner code and bind their model with the HTML controls using model binding. With the passage of time, more features were added and the core .NET web assembly System.Web became quite big and bloated, and contained lots of packages and APIs that were not always useful in every type of application. However, with .NET, several groundbreaking changes were introduced and System.Web got split into NuGet packages that can be referenced and added individually based on requirements.
.NET Core (codename .NET vNext) was first introduced in 2014, and the following are the core benefits of using .NET Core:
Benefit
Description
Cross Platform
.NET Core can run on Windows, Linux, and macOS
Host Agnostic
.NET Core on the server side is not dependent on IIS and, with two lightweight servers, Kestrel and WebListener, it can be self-hosted as a Console application and can be also gelled with mature servers such as IIS, Apache, and others through a reverse proxy option
Modular
Ships as NuGet packages
Open Source
The entire source code is released as open source via the .NET Foundation
CLI tooling
Command line tools to create, build, and run projects from the command line
.NET Core is a cross-platform, open-source framework that implements .NET Standard. It provides a runtime known as .NET Core CLR, framework class libraries, which are primitive libraries known as CoreFX, and APIs that are similar to what .NET Framework has, but have a smaller footprint (lesser dependencies on other assemblies):
.NET Core provides flexible deployment options as follows:
  • Framework-Dependent Deployment (FDD): needs .NET Core SDK to be installed on the machine
  • Self-Contained Deployment (SCD): No machine-wide installation of .NET Core SDK is needed on the machine and .NET Core CLR and framework class libraries are part of the application package
To install .NET Core 2.0, you can navigate to the following link https://www.microsoft.com/net/core and go through the options for installing it on Windows, Linux, MAC, and Docker.

New improvements in .NET Core 2.0

The most recent version of .NET Core, 2.0, comes with a number of improvements. .NET Core 2.0 is the fastest version of all times and can run on multiple platforms including various Linux distros, macOS (operating system), and Windows.
Distros stands for Linux distribution (often abbreviated as distro), and it is an operating system made from a software collection, which is based upon the Linux kernel and, often, a package management system.

Performance improvements

.NET Core is more robust and performance efficient and, since it's open source, the Microsoft team with other community members are bringing more improvements.
The following are the imp...

Table of contents