Filter
Exclude
Time range
-
Near
After nearly 8 years with .NET, here are the tips I wish someone had ranked by actual impact. I updated this article for 2026 and .NET 10. Not all advice is equal. These 5 changed how I build production systems: 1. Dependency Injection - shapes your entire architecture from day one. Get lifetimes wrong, and you get data bleeding between requests. 2. Async/Await - but only for I/O. I benchmarked wrapping CPU-bound code in async. It was slower. 3. EF Core optimization - AsNoTracking() alone gave me 2x speed on a 10K row table. Most teams never turn it on for read queries. 4. Cancellation Tokens - the most underrated tip. Easy to add. Prevents APIs from wasting resources on cancelled requests. 5. Caching - HybridCache in .NET 10 is now the default. It handles the MemoryCache vs Redis debate for you. The full article has 20 tips, each with bad vs better code examples, my honest judgment on when to use what (EF Core vs Dapper, BackgroundService vs Hangfire, when Polly is overkill), and a troubleshooting section for the 5 most common .NET bugs. All 20 tips with code: codewithmukesh.com/blog/20-t… #dotnet #dotnet10 #aspnetcore #webapi #programming
1
11
51
2,521
Replying to @DevLeaderCa
I tried moving to HybridCache from MemoryCache - while I can’t recall the issues, I landed on simply using FusionCache.
2
3
107
Are you a .NET developer looking to speed up data access, reduce database load, or modernize your caching strategy? In this recorded session from Live! 360 Fast Focus session, we walk through practical caching options in .NET, showing how to move from naive in-memory lists to MemoryCache and the newer HybridCache introduced with .NET 9. msft.it/6010tow90
13
68
6,301
𝗬𝗼𝘂𝗿 𝗱𝗮𝘁𝗮 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 𝗰𝗵𝗼𝗶𝗰𝗲𝘀 𝗮𝗿𝗲 𝗸𝗶𝗹𝗹𝗶𝗻𝗴 .𝗡𝗘𝗧 𝗮𝗽𝗽 𝗽𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 Most developers spend hours tuning queries, adding indices, and implementing caching. But they ignore the most critical performance factor: data structure selection. The wrong collections can make your app 10x slower than needed. Here's what to use based on your operation: 1. Finding items by key List<T>.Find() → O(n) → Terrible at scale Dictionary<K,V> → O(1) → Lightning fast 2. Frequently inserting at the beginning List<T>.Insert(0, item) → O(n) → Shifts all elements LinkedList<T> → O(1) → No shifting needed 3. Collection with unique items List<T> Contains check → O(n) per add HashSet<T> → O(1) → Instant uniqueness checks 4. Ordered data with binary search List<T> Sort → O(n log n) manual search code SortedDictionary<K,V> → Built-in ordering O(log n) lookup 5. API response caching Static Dictionary → Memory leaks and stale data MemoryCache with expiration → Automatic cleanup - Repost to help others optimize their .NET apps - Follow me for more
2
43
𝗬𝗼𝘂𝗿 𝗱𝗮𝘁𝗮 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 𝗰𝗵𝗼𝗶𝗰𝗲𝘀 𝗮𝗿𝗲 𝗸𝗶𝗹𝗹𝗶𝗻𝗴 .𝗡𝗘𝗧 𝗮𝗽𝗽 𝗽𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 I optimized 12 enterprise ASP .NET Core systems and found the same problem every time. Most developers spend hours tuning queries, adding indices, and implementing caching. But they ignore the most critical performance factor: data structure selection. The wrong collections can make your app 10x slower than needed. Here's what to use based on your operation: 1. Finding items by key List<T>.Find() → O(n) → Terrible at scale Dictionary<K,V> → O(1) → Lightning fast 2. Frequently inserting at the beginning List<T>.Insert(0, item) → O(n) → Shifts all elements LinkedList<T> → O(1) → No shifting needed 3. Collection with unique items List<T> Contains check → O(n) per add HashSet<T> → O(1) → Instant uniqueness checks 4. Ordered data with binary search List<T> Sort → O(n log n) manual search code SortedDictionary<K,V> → Built-in ordering O(log n) lookup 5. API response caching Static Dictionary → Memory leaks and stale data MemoryCache with expiration → Automatic cleanup I've seen teams waste days on complex optimizations when the right data structure would fix everything. What is the biggest performance problem you solved by picking a correct data structure? — ♻️ Repost to help others optimize their .NET apps ➕ Follow me ( @anton-martyniuk ) for more —
7
34
215
11,357
Just to reiterate. #dotnet #memorycache #caching
1
6
143
I just published FusionCache in .NET: Why It Outperforms MemoryCache & DistributedCache medium.com/asp-dotnet/fusion…
2
5
140
MemoryCache in C#: A Practical Guide isaacl.dev/fox

2
17
1,121
Replying to @dylanbeattie
Cache until X time before expiry can be a good option too. I just shove it in MemoryCache and say it expires some time before it really does to get it evicted and generate a new one.
1
2
143
بعد از حدود ۱۰ سال به نظرم کامل ترین ترکیبی که برای کد زدن پیدا کردم اینه (حداقل میتونم بگم برای نیازهای من ) .net core Sql server Dapper RabbitMQ Quartz Redis(.net memoryCache)
1
48
MemoryCache, DistributedCache and HybridCache #dotnet isaacl.dev/fiq

2
253
MemoryCache, DistributedCache and HybridCache #devdigest devdigest.today/goto/2572

4
28
記事を投稿しました! 【C#】参照型のデータをMemoryCacheで扱ったら事故った話 qiita.com/simoyama2323/items… #Qiita

2
148
One of the best ways to improve performance? Caching. Let's discuss about MemoryCache 👇 The MemoryCache class is a memory-based caching mechanism that's part of the .NET Framework. It's typically used to store objects in memory to improve the performance of .NET applications, by reducing the need to retrieve data from slower external sources like databases or web services. Here are some key aspects of .NET MemoryCache: • Caching Objects: It caches objects in the application's memory. These objects could be any data that you want to store temporarily, such as database query results, web service responses, or computationally expensive data to generate. • Performance Improvement: The primary purpose of using MemoryCache is to improve the performance of applications. It does this by providing quick access to data that would otherwise take longer to retrieve or generate. • Thread-Safe:  It is designed to be thread-safe, which means it can be accessed by multiple threads simultaneously without causing data corruption or inconsistency. • Not Distributed: Unlike distributed caching solutions (like Redis), MemoryCache is local to the application and doesn't share its data with other instances of the application. What about implementation? I'm going to explain how to implement MemoryCache in .NET as detailed as possible. It would be like a tutorial. Don't miss it. Join 10,500 engineers who will read it on Monday here: stefandjokic.tech/?utm_sourc… #dotnet
4
17
106
6,543
15 Jan 2024
Firefox Unleashes its AI Power! #ArtificialIntelligence Exciting news as Firefox introduces MemoryCache, set to be integrated as an extension in the Firefox browser. #AIArtCommuity
1
2
15
457
26 Dec 2023
Mozilla Launches MemoryCache: An On-Device Machine Learning Browser Add-On Bridging Personalized Web Experiences and Privacy itinai.com/mozilla-launches-… #ai #itinai #ainews #new #trend
1
40