From 1e2ae033c8f32f7fb35601eca17edf4783c57a30 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Fri, 5 Apr 2024 00:38:02 +0200 Subject: [PATCH v1] Speed up clean parallel meson builds a lot Building the generated ecpg preproc file can take a long time. You can check how long using: ninja -C build src/interfaces/ecpg/preproc/ecpg.p/meson-generated_.._preproc.c.o This moves that file much closer to the top of our build order, so building it can be pipelined much better with other files. It improved clean build times on my machine (10 cores/20 threads) from ~40 seconds to ~30 seconds. --- src/interfaces/ecpg/meson.build | 2 +- src/meson.build | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/interfaces/ecpg/meson.build b/src/interfaces/ecpg/meson.build index ac42a70a31f..05db32c226e 100644 --- a/src/interfaces/ecpg/meson.build +++ b/src/interfaces/ecpg/meson.build @@ -3,9 +3,9 @@ ecpg_targets = [] subdir('include') +subdir('preproc') subdir('pgtypeslib') subdir('ecpglib') subdir('compatlib') -subdir('preproc') alias_target('ecpg', ecpg_targets) diff --git a/src/meson.build b/src/meson.build index 65c7d17d08f..6f3946ffd54 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,7 +1,12 @@ # Copyright (c) 2022-2024, PostgreSQL Global Development Group # libraries that other subsystems might depend upon first, in their respective -# dependency order +# dependency order. Apart from "interfaces", which we put at the top because +# that speeds up parallel builds significantly since our generated ecpg file +# takes a very long time to build so we want to start that as soon as +# possible. + +subdir('interfaces') subdir('timezone') @@ -11,8 +16,6 @@ subdir('bin') subdir('pl') -subdir('interfaces') - subdir('tools/pg_bsd_indent') base-commit: 88620824c2a62376e224c4b595b9fe69fb858978 -- 2.34.1