This looks harmless:
List<object> list = new(); list.Add(5); // boxing
✅ Fix
Use generics:
List<int> list = new();
Why it matters
-
Boxing allocates memory
-
GC pressure increases fast in loops
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
This looks harmless:
List<object> list = new(); list.Add(5); // boxing
Use generics:
List<int> list = new();
Why it matters
Boxing allocates memory
GC pressure increases fast in loops