dotnet-performance

Optimize .NET performance bottlenecks in EF Core queries, caching, and HttpClient resilience.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/tassosgomes/poc-iam-service --skill dotnet-performance-tassosgomes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-performance
Source: https://github.com/tassosgomes/poc-iam-service/tree/main/.github/skills/csharp/dotnet-performance
Command: npx skills add https://github.com/tassosgomes/poc-iam-service --skill dotnet-performance-tassosgomes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify and fix performance bottlenecks in .NET applications by applying best practices for EF Core queries, caching, and HttpClient resilience.

Core Features & Use Cases

  • EF Core optimizations: AsNoTracking, AsSplitQuery, compiled queries, projections, and safe bulk operations.
  • Caching strategies: Local IMemoryCache and distributed Redis cache patterns with invalidation.
  • HttpClient and resilience: HttpClientFactory configuration, Polly retry, and circuit breaker policies for robust external calls.

Quick Start

Analyze a .NET project to identify EF Core inefficiencies, caching gaps, and HttpClient misconfigurations.

Frequently Asked Questions about dotnet-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize EF Core queries for better performance in ASP.NET Core?

Optimize EF Core queries by applying AsNoTracking for read-only data, AsSplitQuery to avoid cartesian explosions, and compiled queries to reduce query compilation overhead. Projections and safe bulk operations further minimize data transfer and database roundtrips.

What's the best way to implement caching with invalidation in .NET applications?

Implement caching in .NET using local IMemoryCache for in-process storage or distributed Redis cache for shared environments. Apply cache invalidation patterns to ensure data consistency when underlying data changes, preventing stale reads across your ASP.NET Core services.

How do I configure HttpClient resilience with Polly in ASP.NET Core?

Configure HttpClient resilience in ASP.NET Core by using HttpClientFactory with Polly policies. Apply retry policies for transient failures and circuit breaker policies to prevent cascading failures, ensuring robust external HTTP calls during service outages.

When should I use AsNoTracking vs compiled queries in EF Core?

Use AsNoTracking in EF Core for read-only scenarios to skip change tracking overhead, reducing memory and processing time. Use compiled queries when the same LINQ query executes repeatedly, caching the compiled query tree to eliminate per-request compilation costs.

Can I use AsSplitQuery to fix EF Core cartesian explosion performance issues?

Yes, AsSplitQuery fixes EF Core cartesian explosion issues by splitting a single query into multiple SQL queries. This approach loads related collections separately, preventing massive row duplication and reducing memory consumption during multi-join data access.

Does this .NET performance optimization approach work with both in-memory and distributed caching?

Yes, this .NET performance optimization approach works with both in-memory and distributed caching. It supports local IMemoryCache for single-instance scenarios and Redis distributed cache for multi-instance ASP.NET Core deployments, applying invalidation patterns across both.