Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qFeRm-0003RJ-KF for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Jul 2023 17:31:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qFeRk-0004zc-3R for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Jul 2023 17:31:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qFeRj-0004zS-QL for pgsql-hackers@lists.postgresql.org; Sat, 01 Jul 2023 17:31:43 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qFeRc-001UOG-PC for pgsql-hackers@postgresql.org; Sat, 01 Jul 2023 17:31:42 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-577497ec6c6so18035017b3.2 for ; Sat, 01 Jul 2023 10:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1688232695; x=1690824695; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZreGaarZY3oWZEBrrlXPtaQaK0eQ8PQiNXfijCsrEj0=; b=JgdxTwvOyAU9menUguseWs+rdod3XyVRBMTj4rUiYxP4icsMeknJRSuAKeYMI7PWrw fkpZUmvt+dvBKG+/j2VB0YXc2ZoLj8XgHcsRQKU7b0SVzqdya5GGTKE/9SR4hjf/asM7 gAR+3z65pUEL2tmLgC1BnvMj/kCcN8+vRLWSU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688232695; x=1690824695; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZreGaarZY3oWZEBrrlXPtaQaK0eQ8PQiNXfijCsrEj0=; b=D5iSq0GYO51Cy8U6knjJWJXZ+pKw7odV6LbTzJYnF8Hxr4Lz6/+CKoB/eLxMRkzyWf 5d63FeOnaBuO3G2WQaeHYnNVeKN7ZLFmlNZmbIx8Pi3Qsd7aT3bPeNpzQEggAGY1ejXZ 3mgpt8jFrqo2ltzA1lx03LYyJv46xjbH8o2DbAbJmAh0z8oxuK/44NJLCgEpXciJcBEh RoMuUP+LjqerJfnLN5x74KoM+mijNqCBAK83iwojTGSvC5A6zQN9l9Sp6+PQEGkzBRHT YuL35wi0WjJotQOK/bKCURgX3yjU0vl96l1JA0nk+vGR8/K2v3uKR0661hQlQHJuUO/p 18fw== X-Gm-Message-State: ABy/qLZ4S8e3h2Uzp8KaP69w3Qe2TRm8KVC9oqtfAczF2LFHKt66k8Uy dpLGufAeQDDngJWn5yDeDmxfrg== X-Google-Smtp-Source: APBJJlGGKiylvP1CcE57nIhxZ6Z0pu5SsrftWku+86AXw1WCkr3XWOkiERxNgkMXq0VJO7YLtuj0Ig== X-Received: by 2002:a0d:dd88:0:b0:579:e5fb:f6c5 with SMTP id g130-20020a0ddd88000000b00579e5fbf6c5mr1398790ywe.2.1688232695589; Sat, 01 Jul 2023 10:31:35 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id y7-20020a0def07000000b0057072e7fa77sm4100931ywe.95.2023.07.01.10.31.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jul 2023 10:31:34 -0700 (PDT) Date: Sat, 1 Jul 2023 10:31:32 -0700 From: Noah Misch To: Jeff Davis Cc: Peter Eisentraut , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: ICU locale validation / canonicalization Message-ID: <20230701173132.GC2764235@rfd.leadboat.com> References: <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> <5293249a-a361-5a5a-a61e-4e8049a75837@enterprisedb.com> <20230502142938.GA2432446@rfd.leadboat.com> <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, May 20, 2023 at 10:19:30AM -0700, Jeff Davis wrote: > 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? As of commit b8c3f6d, InstallCheck-C got daticulocale=en-US-u-va-posix. Check got daticulocale=NULL. (The machine in question was unusable for PostgreSQL from 2023-05-12 to 2023-06-30, due to https://stackoverflow.com/q/76369660/16371536. That delayed my response.)