Re: Meson far from ready on Windows - Mailing list pgsql-hackers

From walther@technowledgy.de
Subject Re: Meson far from ready on Windows
Date
Msg-id 1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de
Whole thread Raw
In response to Re: Meson far from ready on Windows  (Andres Freund <andres@anarazel.de>)
Responses Re: Meson far from ready on Windows
List pgsql-hackers
Andres Freund:
> FWIW, dynamic linking has a noticeable overhead on other platforms too. A
> non-dependencies-enabled postgres can do about 2x the connections-per-second
> than a fully kitted out postgres can (basically due to more memory mapping
> metadata being copied).  But on windows the overhead is larger because so much
> more happens for every new connections, including loading all dlls from
> scratch.
> 
> I suspect linking a few libraries statically would be quite worth it on
> windows. On other platforms it'd be quite inadvisable to statically link
> libraries, due to security updates, [...]

That's not necessarily true. The nix package manager and thus NixOS 
track all dependencies for a piece of software. If any of the 
dependencies are updated, all dependents are rebuilt, too. So the 
security concern doesn't apply here. There is a "static overlay", which 
builds everything linked fully statically. Unfortunately, PostgreSQL 
doesn't build in that, so far.

Lately, I have been looking into building at least libpq in that static 
overlay, via Meson. There are two related config options:
-Ddefault_library=shared|static|both
-Dprefer_static

The first controls which libraries (libpq, ...) to build ourselves. The 
second controls linking, IIUC also against external dependencies.

Maybe it would be a first step to support -Dprefer_static?

Then this could be set on Windows.

Best,

Wolfgang



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inconsistent Parsing of Offsets with Seconds
Next
From: Shubham Khanna
Date:
Subject: Re: Pgoutput not capturing the generated columns