Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
C# 7 and .NET Core 2.0 High Performance
C# 7 and .NET Core 2.0 High Performance

C# 7 and .NET Core 2.0 High Performance: Build highly performant, multi-threaded, and concurrent applications using C# 7 and .NET Core 2.0

eBook
€8.99 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

C# 7 and .NET Core 2.0 High Performance

Understanding .NET Core Internals and Measuring Performance

When developing application architecture, knowing the internals of how the .NET framework works plays a vital role in ensuring the quality of the application's performance. In this chapter, we will focus on the internals of .NET Core that can help us write quality code and architecture for any application. This chapter will cover some of the core concepts of .NET Core internals, including the compilation process, garbage collection, and Framework Class Library (FCL). We will complete this chapter by going through the BenchmarkDotNet tool, which is mostly used in measuring code performance, and is highly recommended for benchmarking code snippets within an application.

In this chapter, you will learn the following topics:

  • .NET Core internals
  • Utilizing multiple cores of the CPU for high performance
  • How releasing builds...

.NET Core internals

.NET Core contains two core components—the runtime CoreCLR and the base-class libraries CoreFX. In this section, we will cover the following topics:

  • CoreFX
  • CoreCLR
  • Understanding MSIL, CLI, CTS, and CLS
  • How CLR works
  • From compilation to execution—under the hood
  • Garbage collection
  • .NET Native and JIT compilation

CoreFX

CoreFX is the code name of .NET Core's set of libraries. It contains all the libraries that start with Microsoft.* or System.*and contains collections, I/O, string manipulation, reflection, security, and many more features.

The CoreFX is runtime agnostic, and it can run on any platform regardless of what APIs it supports.

To learn more about each assembly, you can refer...

Utilizing multiple cores of the CPU for high performance

These days, the nature of applications focuses more on connectivity, and there are cases where their operations take more time to execute. We also know that nowadays, all computers come with a multi-core processor, and using these cores effectively increases the performance of the application. Operations such as network/IO have latency issues, and the synchronous execution of the application program may often lead to a long waiting time. If the long-running tasks are executed in a separate thread or in an asynchronous manner, the resulting operation will take less time and increase responsiveness. Another benefit is performance that actually utilizes multiple cores of the processor and executes the task simultaneously. In the .NET world, we can achieve responsiveness and performance by splitting the tasks into multiple threads...

How releasing builds increases performance

Release and debug builds are two build modes provided in .NET applications. Debug mode is mostly used when we are in the process of writing code or troubleshooting errors, whereas release build mode is often used while packaging the application to deploy on production servers. When developing the deployment package, developers often miss updating the build mode to the release build, and then they face performance issues when the application is deployed:

The following table shows some differences between the debug and release modes:

Debug

Release

No optimization of code is done by the compiler

Code is optimized and minified in size when built using release mode

Stack trace is captured and thrown at the time of exception

No stack trace is captured

The debug symbols are stored

All code and debug symbols under #debug...

Benchmarking .NET Core 2.0 applications

Benchmarking applications is the process of evaluating and comparing artifacts with the agreed upon standards. To benchmark .NET Core 2.0 application code, we can use the BenchmarkDotNet tool, which provides a very simple API to evaluate the performance of code in your application. Usually, benchmarking at the micro-level, such as with classes and methods, is not an easy task, and requires quite an effort to measure the performance, whereas BenchmarkDotNet does all the low-level plumbing and the complex work associated with benchmark solutions.

Exploring BenchmarkDotNet

In this section, we will explore BenchmarkDotNet and learn how effectively it can be used to measure application performance...

Summary

In this chapter, we have learned about the core concepts of .NET Core, including the compilation process, garbage collection, how to develop high-performant .NET Core applications by utilizing multiple cores of the CPU, and publishing an application using a release build. We have also explored the benchmarking tool, which is highly used for code optimization, and provides results specific to class objects.

In the next chapter, we will learn about multithreading and concurrent programming in .NET Core.

Left arrow icon Right arrow icon

Key benefits

  • 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

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.

Who is this book 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.

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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 25, 2018
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781788474603
Vendor :
Microsoft
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 25, 2018
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781788474603
Vendor :
Microsoft
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
C# Data Structures and Algorithms
€41.99
C# 7 and .NET Core 2.0 High Performance
€36.99
C# and .NET Core Test-Driven Development
€32.99
Total 111.97 Stars icon
Banner background image

Table of Contents

10 Chapters
What's New in .NET Core 2 and C# 7? Chevron down icon Chevron up icon
Understanding .NET Core Internals and Measuring Performance Chevron down icon Chevron up icon
Multithreading and Asynchronous Programming in .NET Core Chevron down icon Chevron up icon
Data Structures and Writing Optimized Code in C# Chevron down icon Chevron up icon
Designing Guidelines for .NET Core Application Performance Chevron down icon Chevron up icon
Memory Management Techniques in .NET Core Chevron down icon Chevron up icon
Securing and Implementing Resilience in .NET Core Applications Chevron down icon Chevron up icon
Microservices Architecture Chevron down icon Chevron up icon
Monitoring Application Performance Using Tools Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.3
(6 Ratings)
5 star 33.3%
4 star 0%
3 star 0%
2 star 0%
1 star 66.7%
Filter icon Filter
Top Reviews

Filter reviews by




Matthew Renze Jul 06, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book provides in-depth knowledge about how to create high-performance cross-platform applications in .NET Core 2.0 with C# 7. It's organized into small bite-sized chunks that are easy to read and comprehend. The book covers quite a bit of ground starting with low-level concepts like data structures, multi-threading, and memory management, working all the way up to high-level concepts like application security, monitoring, and microservice architectures. If you're interested in learning how to get the most out of your .NET Core 2.0 applications, this book is a great place to start!
Amazon Verified review Amazon
Kindle Customer Oct 09, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is an absolute must-read. Clear, simple and efficient explanations and source code, along with topics and short chapters that go straight to the point. This is a book for every professional .NET Core developer (and architect...) to study and apply. Every technical team lead should buy one copy and have the team members read it. I highly, highly recommend this book.
Amazon Verified review Amazon
Ryan T Sep 11, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Examples are poor and in some cases plain incorrect. There is no depth in any of the chapters. I feel the title is a miss leading and bordering on a lie. Would not even recommend this book to an absolute beginner.
Amazon Verified review Amazon
JW Oct 01, 2021
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Do not waste your time with this book. This book has full of incorrect information and mistakes everywhere.
Amazon Verified review Amazon
Nicolas Aug 04, 2021
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Too much mistakes in this book. Examples are poor and not helpful. The title is misleading as you could think you will learn something about High Performance. It is absolutely not the case. I do not recommend this book, it doesn't worth the price.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.