|From:||Andres Freund <andres(at)anarazel(dot)de>|
|To:||pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>|
|Subject:||meson: Add support for building with precompiled headers|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
This is a patch split off from the initial meson thread  as it's
functionally largely independent (as suggested in ).
Using precompiled headers substantially speeds up building for windows, due to
the vast amount of headers included via windows.h. A cross build from
linux targetting mingw goes from
994.11user 136.43system 0:31.58elapsed 3579%CPU
422.41user 89.05system 0:14.35elapsed 3562%CPU
The wins on windows are similar-ish (but I don't have a system at hand just
now for actual numbers). Targetting other operating systems the wins are far
smaller (tested linux, macOS, FreeBSD).
This is particularly interesting for cfbot, which spends a lot of time
building on windows. It also makes developing on windows less painful as the
gains are bigger when compiling incrementally, because the precompiled headers
don't typically have to be rebuilt.
As a prerequisite this requires changing the way FD_SETSIZE is defined when
When using precompiled headers we cannot override macros in system headers
from within .c files, as headers are already processed before the #define in
the C file is reached.
A few files #define FD_SETSIZE 1024 on windows, as the default is only 64. I
am hesitant to change FD_SETSIZE globally on windows, due to
src/backend/port/win32/socket.c using it to size on-stack arrays. Instead add
-DFD_SETSIZE=1024 when building the specific targets needing it.
We likely should move away from using select() in those places, but that's a
Michael, CCing you wrt the second patch, as Thomas noticed  that you were
looking at where to define FD_SETSIZE.
|Next Message||Garen Torikian||2022-10-05 19:34:49||Re: [PATCH] Expand character set for ltree labels|
|Previous Message||Nathan Bossart||2022-10-05 19:00:55||Re: Startup process on a hot standby crashes with an error "invalid memory alloc request size 1073741824" while replaying "Standby/LOCK" records|