Page MenuHomePhabricator

Exceptions should be catched as "const reference" for better performance
Closed, ResolvedPublic

Description

Exceptions should be catched as "const reference" for better performance.

  • Adapt examples in the documentation
  • Change all current catch blocks to const refrence

Event Timeline

Actually, I would never try to invest in performant error handling, because we don't want that to happen too often. However, it does not hut, so feel free to change it.

It is not only about better performance, but also to avoid memory allocation problems during copy constructor calls if exceptions have been thrown because of low-memory situations.

But mostly, it is just the recommended exception catching "style" :-)

In my opinion the documentation should be adapted as soon as possible so new implementations will (hopefully) be done in the right way. This is easy, so setting this bug to party_easy.

Adapting all the old try and catch blocks will be a lot of work, unless someone writes a script. I don't think that this is that important...

Adapting exception handling documentation: catch const reference exceptions

User eisenman has pushed new remote branch:

bug-13051-ExceptionHandlingDocumentation

[867af5]: Merge branch 'bug-13051-ExceptionHandlingDocumentation'

Merged commits:

2014-10-22 17:00:30 Matthias Eisenmann [2d3001]
Catch const reference exceptions.