Re: Clang optimiser vs preproc.c

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Clang optimiser vs preproc.c
Дата
Msg-id 20231216122900.vieawai3b42pxuj4@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Clang optimiser vs preproc.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Clang optimiser vs preproc.c  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi,

On 2023-12-15 22:19:56 -0500, Tom Lane wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > On Sat, Dec 16, 2023 at 3:44 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Thomas Munro <thomas.munro@gmail.com> writes:
> >>> FYI, it looks like there is a big jump in CPU time to compile preproc.c at -O2:
> >>> clang15: ~16s
> >>> clang16: ~211s
> >>> clang17: ~233s

Is this with non-assert clangs? Because I see times that seem smaller by more
than what can be explained by hardware differences:

preproc.c:
17   10.270s
16    9.685s
15    8.300s

gram.c:
17    1.936s
16    2.131s
15    2.161s

That's still bad, but a far cry away from 233s.


> Huh.  There's not that many more productions in the ecpg grammar
> than the core, so it doesn't seem likely that this is purely a
> size-of-file issue.  I'd bet on there being something that clang
> doesn't do well about the (very stylized) C code being generated
> within the grammar productions.
> 
> We actually noticed this or a closely-related problem before [1]
> and briefly discussed the possibility of rearranging the generated
> code to make it less indigestible to clang.  But there was no concrete
> idea about what to do specifically, and the thread slid off the radar
> screen.

One interest aspect might be that preproc.c ends up with ~33% more states than
gram.c

gram.c:
#define YYLAST   116587

preproc.c:
#define YYLAST   155495


Greetings,

Andres Freund



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Improve eviction algorithm in ReorderBuffer
Следующее
От: jian he
Дата:
Сообщение: Re: Adding OLD/NEW support to RETURNING