inline newNode()

Поиск
Список
Период
Сортировка
От Neil Conway
Тема inline newNode()
Дата
Msg-id 87vg4eosqx.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответы Re: inline newNode()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
I've been taking a look at improving the performance of the GEQO
code. Before looking at algorithmic improvements, I noticed some
"low-hanging fruit": gprof revealed that newNode() was a hotspot. When
I altered it to be an inline function, the overall time to plan a
12-table table join (using the default GEQO settings) dropped by about
9%. I haven't taken a look at how the patch effects the other places
that use newNode(), but it stands to reason that they'd see a
performance improvement as well (although probably less noticeable).

However, I'm not sure if I used the correct syntax for inlining the
function (since it was originally declared in a header and defined
elsewhere, I couldn't just add 'inline'). The method I used (declaring
the function 'extern inline' and defining it in the header file) works
for me with GCC 3.2, but I'm open to suggestions for improvement.

BTW, after applying the patch, the GEQO profile looks like:

  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 16.07      0.18     0.18  4618735     0.00     0.00  compare_path_costs
  9.82      0.29     0.11  2149666     0.00     0.00  AllocSetAlloc
  8.04      0.38     0.09   396333     0.00     0.00  add_path
  4.46      0.43     0.05  2149661     0.00     0.00  MemoryContextAlloc
  3.57      0.47     0.04  1150953     0.00     0.00  compare_pathkeys

(Yes, gprof on my machine is still a bit fubared...)

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: tweak CREATE SEQUENCE grammar
Следующее
От: Tom Lane
Дата:
Сообщение: Re: inline newNode()