Re: Performance Implications of Using Exceptions

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Performance Implications of Using Exceptions
Дата
Msg-id 20080401005235.GM4999@tamriel.snowman.net
обсуждение исходный текст
Ответ на Performance Implications of Using Exceptions  ("Ravi Chemudugunta" <chemuduguntar@gmail.com>)
Ответы Re: Performance Implications of Using Exceptions  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
Re: Performance Implications of Using Exceptions  ("Ravi Chemudugunta" <chemuduguntar@gmail.com>)
Список pgsql-performance
* Ravi Chemudugunta (chemuduguntar@gmail.com) wrote:
> Which version is faster?

In general I would recommend that you benchmark them using
as-close-to-real load as possible again as-real-as-possible data.

> Does the exception mechanism add any overhead?

Yes, using exceptions adds a fair bit of overhead.  Quote from the
documentation found here:
http://www.postgresql.org/docs/8.3/static/plpgsql-control-structures.html

Tip:  A block containing an EXCEPTION clause is significantly more
expensive to enter and exit than a block without one. Therefore, don't
use EXCEPTION without need.

> Which is more cleaner?

That would be in the eye of the beholder, generally.  Given the lack of
complexity, I don't think 'cleanness' in this case really matters all
that much.

    Enjoy,

        Stephen

Вложения

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Ravi Chemudugunta"
Дата:
Сообщение: Performance Implications of Using Exceptions
Следующее
От: "Stephen Denne"
Дата:
Сообщение: Re: Performance Implications of Using Exceptions