Tutorials ADO.NET Core Tutorial
Performance Optimization — Complete Guide
Performance Optimization — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of ADO.NET Core Tutorial on Toolliyo Academy.
On this page
ADO.NET Core Tutorial · Lesson 28 of 100
Performance Optimization
Foundations ✓ → SQL & safety → Production → Projects
SQL & safety · 2 — Procs, tx, performance · ~6 min · Module 3: Stored Procedures
What is this?
ADO.NET performance starts with measuring: duration, reads, pool waits — then fix SQL/indexes/round trips.
Why should you care?
ShopNest sale incidents are usually slow SQL or pool leaks, not “C# too slow.”
See it live — copy this example
Use a .NET console or API project with SQL Server LocalDB. Run dotnet run after pasting.
var sw = System.Diagnostics.Stopwatch.StartNew();
await cmd.ExecuteReaderAsync(ct);
sw.Stop();
Console.WriteLine($"ms={sw.ElapsedMilliseconds}");
What happened?
- Log timings.
- Use SSMS plans.
- Cut SELECT *, add indexes, batch, async, dispose.
Practice next
- Time a hot query.
- Capture actual plan.
- Remove SELECT *.
- Compare before/after index.
- Log Parameter values in dev only.
Remember
Measure first. Fix SQL & pooling. Fewer round trips.
ShopNest p95 hunt
Team times place-order SQL.
Outcome: One missing index fixed the spike.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!