12 EF Core performance tuning
This chapter covers
- Deciding which performance issues to fix
- Techniques for finding performance issues
- Using patterns that promote good performance
- Finding patterns that cause performance issues
This chapter is the first of two covering performance tuning your database accesses. Covering what, where, and how to improve your EF Core database code, this chapter is divided into three parts:
- Part 1 —Understanding performance, the difference between speed and scalability, deciding what to performance tune, and determining the costs of performance tuning.
- Part 2 —Techniques you can use to find performance issues and the use of EF Core’s logging to help you spot problems.
- Part 3 —A whole range of database access patterns, both good and bad, to help you diagnose and fix many EF Core performance issues.
In chapter 13, you’ll apply the approaches shown in this chapter to the book app’s book list query. You’ll start by tuning EF Core code and then progress to more-complex techniques, such as using raw SQL commands to squeeze the best performance out of the database accesses.
12.1 Part 1—Deciding which performance issues to fix
Before describing how to find and fix performance issues, I want to provide an overview of the subject of performance. Although you can ignore performance at the start of a project, some concepts might help you later, when someone says, “The application is too slow—fix it.”