Try Catch influences performance? [duplicate]

-1

Use% of% influence on performance? in memory usage?

Would it be a problem if all the actions you do have error handling?

  try
  {
    clienteRepository.Salvar(entity);
  }
  catch (Exception e)
  {
    emailService.EnviaErro(e);
  }
    
asked by anonymous 24.10.2014 / 13:45

1 answer

-1

Yes, it has a minimal impact on runtime, unless you make big loops inside the try, use only when necessary and avoid using Exception, use the exception according to the type of error that is expected to happen, example opening a connection to a bd use SQLException.

And in relation to performance do you prefer performance or avoiding a crash?

    
24.10.2014 / 14:17