void Log(IFormattable value)
Passing structs through interfaces causes boxing.
Fix
Use generics:
void Log<T>(T value) where T : IFormattable
Result: zero allocations, faster execution.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
void Log(IFormattable value)
Passing structs through interfaces causes boxing.
Use generics:
void Log<T>(T value) where T : IFormattable
Result: zero allocations, faster execution.