Re: Clang optimiser vs preproc.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Clang optimiser vs preproc.c
Date
Msg-id 3373013.1702696796@sss.pgh.pa.us
Whole thread Raw
In response to Re: Clang optimiser vs preproc.c  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Clang optimiser vs preproc.c
Re: Clang optimiser vs preproc.c
List pgsql-hackers
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

>> What are the numbers for gram.c?

> clang15: ~3.8s
> clang16: ~3.2s
> clang17: ~2.9s

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.

            regards, tom lane

[1] https://www.postgresql.org/message-id/20220902174033.wgt6li7oiaxmwftn@awork3.anarazel.de



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Clang optimiser vs preproc.c
Next
From: Corey Huinker
Date:
Subject: Re: Statistics Import and Export