Re: [RFC] building postgres with meson

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] building postgres with meson
Date: 2021-10-12 09:08:29
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2021-10-12 01:37:21 -0700, Andres Freund wrote:
> non-cached build (world-bin):
> current: 40.46s
> ninja: 7.31s

Interestingly this is pretty close to the minimum achievable on my
machine from the buildsystem perspective.

A build with -fuse-ld=lld, which the above didn't use, takes 6.979s. The
critical path is

bison gram.y -> gram.c 4.13s
gcc gram.c -> gram.o 2.05s
gcc postgres .... 0.317

A very helpful visualization is to transform ninja's build logs into a
tracefile with

I attached an example - the trace.json.gz can be uploaded as-is to

It's quite a bit of of fun to look at imo.

There's a few other things quickly apparent:

- genbki prevents build progress due to dependencies on the generated
- the absolutely stupid way I implemented the python2->python3
regression test output conversion uses up a fair bit of resources
- tablecmds.c, pg_dump.c, xlog.c and a few other files are starting to
big enough to be problematic compile-time wise


Andres Freund

Attachment Content-Type Size
trace.json.gz application/gzip 23.6 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-10-12 09:27:58 Re: Inconsistency in startup process's MyBackendId and procsignal array registration with ProcSignalInit()
Previous Message Andres Freund 2021-10-12 08:37:21 [RFC] building postgres with meson