is python exception slow? I'm kind using python exceptions to structure programm follow in my web application, and I'm wondering how throwing exceptions will affect performance of my application. what is your thoughts?
which one of the following statements is less expensive in terms of memory and cpu?
try:
artist = Artist.objects.get(id=id)
except:
raise Http404
artist = Artist.objects.filter(id=id)
if not artist:
return HttpResponse('404')