Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)
Дата
Msg-id 603c8f070901141045h604ade55k14b4e446dfb00663@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
> It's not in C89 but look up "alloca".

I know about alloca...

> We don't use it anywhere in postgres currently so it's kind of unlikely we
> would start now.

:-(

>> Obviously this is a bad plan if x can be a big number because you
>> might crash your stack, but suppose we know that's not an issue?  It
>> seems a shame to have to do palloc/pfree in a situation like this.
>
> palloc really isn't that expensive, unless you're allocating tons of tiny
> objects or you're in a tight loop it's not worth worrying about.

Yeah... but...

It really depends on what you compare it to.  It's cheap compared to
99% of the functions in the code base - perhaps so.  But it's darn
expensive compared to moving the stack pointer.  I have seen profiles
for PostgreSQL and other systems where memory management is a sizable
percentage of the CPU time, so it is not silly to worry about
economizing.

...Robert


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: New patch for Column-level privileges
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Updates of SE-PostgreSQL 8.4devel patches (r1403)