Optimizing Slow .NET Backend API with EF Core

Day 1/100 – Becoming a Better .NET Backend Developer Starting a 100-day consistency challenge to sharpen my backend engineering skills and share real-world learnings along the way Today’s Focus: Optimizing a Slow API (EF Core) I came across an API endpoint that was taking ~4–5 seconds to respond . What I improved: Removed unnecessary .ToList() before filtering Used .Select() to fetch only required fields Added indexing on frequently queried columns Switched to async calls (ToListAsync) Result: Improved response time from ~5s → under 500ms Key Takeaways: Avoid loading unnecessary data from DB Always use projections when possible Indexing can drastically improve performance Async != faster always, but improves scalability This is something I’m actively focusing on while building real-world APIs and improving performance mindset. 💬 Curious — what’s the biggest performance issue you’ve faced in APIs? #100DaysOfCode #dotnet #efcore #backend #webapi #performance #softwareengineering #learninginpublic

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories