From: Jeff Davis <pgsql@j-davis.com>
To: Noah Misch <noah@leadboat.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: ICU locale validation / canonicalization
Date: Sat, 20 May 2023 10:19:30 -0700
Message-ID: <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com> (raw)
In-Reply-To: <20230502142938.GA2432446@rfd.leadboat.com>
References: <b29cdc9b-1176-4456-e909-8fd64af03af8@enterprisedb.com>
<c6dd63de8267ad8267ce4ec939f72c43f1fc2020.camel@j-davis.com>
<7ee414ad-deb5-1144-8a0e-b34ae3b71cd5@enterprisedb.com>
<4efdd7bdf9c811e1a32b8d10524bae8040367068.camel@j-davis.com>
<6880701fd5cd5183ad7ff3a73d5c9291d6c2e331.camel@j-davis.com>
<04182066-7655-344a-b8b7-040b1b2490fb@enterprisedb.com>
<2a9013df9a197aa5eb2d85b5f7ec0c5a726b6a2e.camel@j-davis.com>
<3e45a760-a7f8-80af-e4b0-be91427359d3@enterprisedb.com>
<bf099831a79a2a3e05cdbf27d216f16ba2ddb6cb.camel@j-davis.com>
<5293249a-a361-5a5a-a61e-4e8049a75837@enterprisedb.com>
<20230502142938.GA2432446@rfd.leadboat.com>
On Tue, 2023-05-02 at 07:29 -0700, Noah Misch wrote:
> On Thu, Mar 30, 2023 at 08:59:41AM +0200, Peter Eisentraut wrote:
> > On 30.03.23 04:33, Jeff Davis wrote:
> > > Attached is a new version of the final patch, which performs
> > > canonicalization. I'm not 100% sure that it's wanted, but it
> > > still
> > > seems like a good idea to get the locales into a standard format
> > > in the
> > > catalogs, and if a lot more people start using ICU in v16
> > > (because it's
> > > the default), then it would be a good time to do it. But perhaps
> > > there
> > > are risks?
> >
> > I say, let's do it.
>
> The following is not cause for postgresql.git changes at this time,
> but I'm
> sharing it in case it saves someone else the study effort. Commit
> ea1db8a
> ("Canonicalize ICU locale names to language tags.") slowed buildfarm
> member
> hoverfly, but that disappears if I drop debug_parallel_query from its
> config.
> Typical end-to-end duration rose from 2h5m to 2h55m. Most-affected
> were
> installcheck runs, which rose from 11m to 19m. (The "check" stage
> uses
> NO_LOCALE=1, so it changed less.) From profiles, my theory is that
> each of
> the many parallel workers burns notable CPU and I/O opening its ICU
> collator
> for the first time.
I didn't repro the overall test timings (mine is ~1m40s compared to
~11-19m on hoverfly) but I think a microbenchmark on the ICU calls
showed a possible cause.
I ran open in a loop 10M times on the requested locale. The root locale
("und"[1], "root" and "") take about 1.3s to open 10M times; simple
locales like 'en' and 'fr-CA' and 'de-DE' are all a little shower at
3.3s.
Unrecognized locales like "xyz" take about 10 times as long: 13s to
open 10M times, presumably to perform the fallback logic that
ultimately opens the root locale. Not sure if 10X slower in the open
path is enough to explain the overall test slowdown.
My guess is that the ICU locale for these tests is not recognized, or
is some other locale that opens slowly. Can you tell me the actual
daticulocale?
Regards,
Jeff Davis
[1] It appears that "und" is also slow to open in ICU < 64. Hoverfly is
on v58, so it's possible that's the problem if daticulocale=und.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: pgsql@j-davis.com, noah@leadboat.com, peter.eisentraut@enterprisedb.com, robertmhaas@gmail.com
Subject: Re: ICU locale validation / canonicalization
In-Reply-To: <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com>
References: <b29cdc9b-1176-4456-e909-8fd64af03af8@enterprisedb.com> <c6dd63de8267ad8267ce4ec939f72c43f1fc2020.camel@j-davis.com> <7ee414ad-deb5-1144-8a0e-b34ae3b71cd5@enterprisedb.com> <4efdd7bdf9c811e1a32b8d10524bae8040367068.camel@j-davis.com> <6880701fd5cd5183ad7ff3a73d5c9291d6c2e331.camel@j-davis.com> <04182066-7655-344a-b8b7-040b1b2490fb@enterprisedb.com> <2a9013df9a197aa5eb2d85b5f7ec0c5a726b6a2e.camel@j-davis.com> <3e45a760-a7f8-80af-e4b0-be91427359d3@enterprisedb.com> <bf099831a79a2a3e05cdbf27d216f16ba2ddb6cb.camel@j-davis.com> <5293249a-a361-5a5a-a61e-4e8049a75837@enterprisedb.com> <20230502142938.GA2432446@rfd.leadboat.com> <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com>
* 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