13 A worked example of performance tuning
This chapter covers
- Ensuring that your LINQ query translates into good SQL
- Using EF Core’s DbFunction to improve a query
- Building high-performance queries via raw SQL
- Using cached values to improve performance
- Trading development effort for performance gains
Section 12.1.2 showed that the book list query needs to have great performance, so this chapter is about performance-tuning that query. The query has already avoided nearly all the performance issues mentioned in chapter 12, so you must go beyond the normal changes to make any further improvements. This chapter takes you through a series of performance-tuning steps, starting with EF Core–focused approaches and then branching out to more-extreme changes to get the best performance possible.
The aim is to show you how to tackle performance-tuning an application, and the amount of effort needed to get that next level in performance. You may never need some of the extreme performance-tuning techniques covered here, but at least you’ll know that better performance is possible if you need it.
This chapter is divided into four distinct parts for improving the performance of the book list query: