Re: Optimizing PostgreSQL with LLVM's PGO+LTO

From: Andres Freund <andres(at)anarazel(dot)de>
To: João Paulo Labegalini de Carvalho <jaopaulolc(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimizing PostgreSQL with LLVM's PGO+LTO
Date: 2023-01-27 23:07:52
Message-ID: 20230127230752.3tc5crhrdgeoker2@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-01-27 23:08:50 Re: Optimizing PostgreSQL with LLVM's PGO+LTO
Previous Message Mark Dilger 2023-01-27 22:56:04 Re: Non-superuser subscription owners