Re: Optimizing PostgreSQL with LLVM's PGO+LTO - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Optimizing PostgreSQL with LLVM's PGO+LTO
Date
Msg-id 20230127230752.3tc5crhrdgeoker2@awork3.anarazel.de
Whole thread Raw
In response to Optimizing PostgreSQL with LLVM's PGO+LTO  (João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com>)
Responses Re: Optimizing PostgreSQL with LLVM's PGO+LTO
List pgsql-hackers
Hi,

On 2023-01-27 10:05:09 -0700, João Paulo Labegalini de Carvalho wrote:
> I am investigating the benefits of different profile-guided optimizations
> (PGO) and link-time optimizations (LTO) versus binary optimizers (e.g.
> BOLT) for applications such as PostgreSQL.
> 
> I am facing issues when applying LTO to PostgreSQL as the produced binary
> seems broken (the server dies quickly after it has started). This is
> definitely a compiler bug, but I was wondering if anyone here  have
> experimented with LTO for PostgreSQL.

What compiler / version / flags / OS did you try?


FWIW, I've experimented with LTO and PGO a bunch, both with gcc and clang. I
did hit a crash in gcc, but that did turn out to be a compiler bug, and
actually reduced to something not even needing LTO.

I saw quite substantial speedups with PGO, but I only tested very specific
workloads. IIRC it was >15% gain in concurrent readonly pgbench.


I dimly recall failing to get some benefit out of bolt for some reason that I
unfortunately don't even vaguely recall.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: Non-superuser subscription owners
Next
From: Andres Freund
Date:
Subject: Re: Optimizing PostgreSQL with LLVM's PGO+LTO