Exceptions are expensive.
Bad
try
{
Parse(input);
}
catch { }
Better
if (TryParse(input, out var result))
{
...
}
Why
Exceptions unwind stacks and allocate memory.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
Exceptions are expensive.
Bad
try
{
Parse(input);
}
catch { }
Better
if (TryParse(input, out var result))
{
...
}
Why
Exceptions unwind stacks and allocate memory.