Re: [RFC] building postgres with meson - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [RFC] building postgres with meson
Date
Msg-id 20211012090829.2j7jro5amntzi6uz@alap3.anarazel.de
Whole thread Raw
In response to [RFC] building postgres with meson  (Andres Freund <andres@anarazel.de>)
Responses Re: [RFC] building postgres with meson
List pgsql-hackers
Hi,

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 https://github.com/nico/ninjatracing

I attached an example - the trace.json.gz can be uploaded as-is to
https://ui.perfetto.dev/

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
  headers.
- 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

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: [RFC] building postgres with meson
Next
From: Bharath Rupireddy
Date:
Subject: Re: Inconsistency in startup process's MyBackendId and procsignal array registration with ProcSignalInit()