
Explore high performance coding in .NET Core and C# through measuring performance, profiling tools, optimization techniques, Span and ArrayPool, EF Core, and production monitoring.
Trace the history of .NET Core and its performance focus, compare it with the classic .NET framework, and understand why ASP.NET Core delivers high performance for cross-platform, cloud-ready applications.
Explore core .NET concepts and definitions, including .NET Standard 2.0, deployment options (self contained vs shared framework), and .NET Core 2.0 application types to boost cross-platform code sharing and performance.
Measure CPU performance using profiling concepts, comparing sampling and instrumentation. Analyze inclusive and exclusive samples, establish baselines, and track CPU utilization and wall clock time with Visual Studio.
Explore how the .NET garbage collector manages the managed heap, identify memory allocations and GC roots, and profile memory to prevent leaks in .NET Core.
Visual Studio diagnostic tools window provides live CPU and memory data, memory snapshots, and GC insight to diagnose and fix performance bottlenecks in .NET Core apps.
Learn to diagnose .NET Core performance with ETW and PerfView, collect ETW events, view CPU stacks, and analyze GC behavior, memory allocations, and heap snapshots.
Use BenchmarkDotNet to obtain accurate, repeatable micro benchmarks for .NET methods, with warm-up, automatic iterations, and memory diagnostics. Run on Windows and Linux to compare results and generate detailed reports.
Explore dotnet core performance diagnostics on Linux using perf sampling, flame graphs, and lttng to analyze CoreCLR events and optimize your applications.
Explore macro benchmarking with stackify prefix on an ASP.NET Core app, measuring Http and database calls to reveal dependencies and performance.
Learn how to monitor .NET Core performance using manual instrumentation with Mini Profiler across platforms, including configuring startup, measuring incoming requests, database calls, and http calls.
Learn how value types and reference types differ, how their storage on stack and heap affects GC pressure, and how headers like sink block index and method table influence performance.
Compare value types and reference types via a demo, showing how proper equals and the equatable interface reduce boxing and gc pressure, with benchmarks and guidance for structs in collections.
Explore how async and await enable true asynchronous programming with http client calls and IO tasks, while clarifying misconceptions about threads and performance in UI and ASP.NET Core.
Explore how async/await in a high load ASP.Net Core app saves threads by shifting IO operations to async calls, demonstrated with Http client versus web request.
Explore built-in dotnet core collections, compare array, list, linked list, dictionaries, hash sets, and sorted variants, and evaluate their data structures, performance, and ordering characteristics.
Explore how 1 million-item demos compare list versus linked list, hashset, and dictionary performance, highlighting cache locality, insertion costs, and gethashcode effects in .NET Core and C#.
Explore how C# 7 features influence performance in .NET Core, including local functions, ref returns, tuples, and async methods, with insights into the CLR and generated code.
learn how local functions in C# seven avoid heap allocations and are faster than delegates, demonstrated with a tight loop calculating average true range.
Explore how ref return and ref local improve performance by avoiding copies of big value types, with examples using arrays and big structs in C# 7.
Examine the performance characteristics of the C# 7 tuple feature, comparing ValueTuple-based implementations to classic System.Tuple and their impact on heap allocation and GC.
Explore optimization of async methods with value task, introduced in C# seven, and learn when a value task can avoid heap allocations in cached async APIs.
Explore how pattern matching in C# 7 improves performance by comparing type patterns, switch patterns, and when clauses, with insights into generated code and type checks.
Learn to reuse arrays with the array pool in .NET Core and .NET Standard, reducing garbage collection and large object heap pressure.
Explore how span unifies access to managed, unmanaged, and stack memory in .NET to enable high-performance parsing and slicing without copying.
Discover how span enables safe memory access across memory types, using slice views to avoid allocations. The demo compares string parsing with span to substring, and notes array pool benefits.
Speed up Entity Framework Core queries by pushing filtering to the database, projecting only required columns, paging results, and loading only necessary dependent entities asynchronously with profiling.
Recognize and fix the n plus one problem using eager loading with include and explicit loading to fetch dependent entities in Entity Framework Core.
Learn how to boost EF Core performance by informing the framework of data types and max lengths, avoiding client-side execution, and using no-tracking for read-only queries.
Explore Cross-gen for .NET Core to generate native images and reduce runtime JIT, and learn how the Mono linker shrinks unused code while ASP.NET Core precompiled views speed startup.
Discover how Mono's linker for .NET Core removes unused code from self-contained apps to shrink deployment packages, with size reductions and considerations for reflection and the linker's preview status.
Enable precompiled views in ASP.NET Core to avoid runtime view compilation, speeding startup and reducing deployment size; learn how to publish, check for precompiled DLLs, and consider version-specific limitations.
Enable Application Insights for an ASP.NET Core app, push telemetry to Azure, and use the Application Map to monitor production performance and dependencies.
Track slow requests and perform performance tests with Application Insights to identify bottlenecks in production. Analyze dependencies, simulate load, and optimize caching and backend services.
Instrument your .NET Core apps with Application Insights to track custom dependencies, metrics, and events using the telemetry client, and visualize performance via the Azure portal.
Monitor asp.net core applications with dynatrace and leverage smartscape, service flow, and custom service monitoring for a historical data storage. Observe end-to-end requests across data centers and azure app service.
A few years ago, Microsoft decided to radically redefine the .NET platform. An open-source, cross-platform, high performance flavor of the .NET framework was created: this is .NET Core. Additionally, C#, the most widely used .NET programming language also evolved over the years. These new developments include many performance improvements.
The goal of the course is to give you deep understanding about these performance improvements. By applying the knowledge from this course, you will be able to measure and optimize the performance of .NET Core (including ASP.NET Core), C# applications.
After a short wrap-up on .NET Core the course introduces you to the first pillar of the performance topic: measuring performance. You will learn to use tools that you can apply to measure the performance of your code running on .NET Core. Then we will focus on some important performance tricks like reducing the pressure on the GC by using value types or choosing the right collection for the given problem. After that we will see what the compiler does behind the scenes when it compiles your C# 7 code and what performance implications this has. We will talk about some new performance related APIs like ArrayPool and Span and we will also look into the performance aspects of Entity Framework Core. We will talk about the ahead of time compilation story for .NET with CrossGen and IL trimming with the .NET IL Linker. We will finish the course by learning about production performance monitoring for .NET Core.
Goal of the course
Course style
The course is a mix of theory and practice. Tools and concepts with their theoretical background will be introduced with slides and then the theoretical knowledge will be applied in demos.