Re: SP-GiST micro-optimizations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SP-GiST micro-optimizations
Дата
Msg-id 4042.1346175044@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SP-GiST micro-optimizations  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: SP-GiST micro-optimizations
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Drilling into the profile, I came up with three little optimizations:

> 1. Within spgdoinsert, a significant portion of the CPU time is spent on 
> line 2033 in spgdoinsert.c:

> memset(&out, 0, sizeof(out));

> That zeroes out a small struct allocated in the stack. Replacing that 
> with MemSet() makes it faster, reducing the time spent on zeroing that 
> struct from 10% to 1.5% of the time spent in spgdoinsert(). That's not 
> very much in the big scheme of things, but it's a trivial change so 
> seems worth it.

Fascinating.  I'd been of the opinion that modern compilers would inline
memset() for themselves and MemSet was probably not better than what the
compiler could do these days.  What platform are you testing on?

The other two changes seem reasonable.
        regards, tom lane



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

Предыдущее
От: David Fetter
Дата:
Сообщение: "default deny" for roles
Следующее
От: Robert Haas
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB