Re: [PATCH] Fix severe performance regression with gettext 0.20+ on Windows - Mailing list pgsql-hackers

From Bryan Green
Subject Re: [PATCH] Fix severe performance regression with gettext 0.20+ on Windows
Date
Msg-id d825be18-ed3e-439d-9a52-39a58b133025@gmail.com
Whole thread Raw
In response to Re: [PATCH] Fix severe performance regression with gettext 0.20+ on Windows  (Andres Freund <andres@anarazel.de>)
Responses Re: [PATCH] Fix severe performance regression with gettext 0.20+ on Windows
List pgsql-hackers
On 12/11/2025 10:05 AM, Andres Freund wrote:
> Hi,
> 
> On 2025-12-11 15:43:36 +0100, Peter Eisentraut wrote:
>> On 10.12.25 01:45, Bryan Green wrote:
>>> The attached patch takes a pragmatic approach: for gettext 0.20.1+, we
>>> avoid triggering the bug by using Windows locale format instead of
>>> calling IsoLocaleName(). This works because gettext 0.20.1+ internally
>>> converts the Windows format back to POSIX for catalog lookups, whereas
>>> 0.19.8 and earlier need POSIX format directly.
>>
>> I can confirm that this patch fixes the performance deviation from
>> activating --enable-nls on Windows (tested with MSYS2/UCRT64).
> 
> FWIW, Bilal and I had, IIRC, explicitly not enabled on windows CI because it
> made the build process even slower. But perhaps we should re-measure the
> difference and re-consider?
> 
> Greetings,
> 
> Andres Freund
As long as you use Windows locale names once this patch is in place.
Posix locale names will still incur the performance hit until the next
gettext release. Once using the next gettext release there will not be a
performance penalty for using an invalid locale on Windows.


-- 
Bryan Green
EDB: https://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Add a greedy join search algorithm to handle large join problems
Next
From: Jacob Champion
Date:
Subject: Re: Serverside SNI support in libpq