pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: walther@technowledgy.de
To: Andres Freund <andres@anarazel.de>
To: Dave Page <dpage@pgadmin.org>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Meson far from ready on Windows
Date: Sat, 22 Jun 2024 19:32:01 +0200
Message-ID: <1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de> (raw)
In-Reply-To: <20240622163225.2tqid4xzpjt3lwiy@alap3.anarazel.de>
References: <CA+OCxowQhMHFNRLTsXNuJpC96KRtSPHYKJuOS=b-Zrwmy-P4-g@mail.gmail.com>
	<20240618143850.nl67cwctsodmgfpi@awork3.anarazel.de>
	<CA+OCxoxwwA7u3mw9r7+miRzxdwzet9=Xq3JxVFpkd6TajP9eGA@mail.gmail.com>
	<20240618160845.gbqkiv4dbjghlp63@awork3.anarazel.de>
	<CA+OCxozsg3NOkTfK4KCb0gmxwnaNv4P=yuMZe_CgeXTM=ZGW7g@mail.gmail.com>
	<20240620205849.whd3434zoqqm2iy4@awork3.anarazel.de>
	<CA+OCxoxJ075+R63sgsHBExB+x3BV3o1xs9EBxGEuYmZQOkW=UQ@mail.gmail.com>
	<20240622163225.2tqid4xzpjt3lwiy@alap3.anarazel.de>

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





view thread (31+ messages)  latest in thread

Message-ID: <1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de>
Permalink:  ../1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de/
Also on:    postgresql.org/message-id/1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: walther@technowledgy.de, andres@anarazel.de, dpage@pgadmin.org, byavuz81@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Meson far from ready on Windows
  In-Reply-To: <1e1a8772-d13c-43fc-b1b2-e9a0324e313e@technowledgy.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox