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 1q0QF7-0001Xs-BD for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 17:19:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0QF4-0000UE-8n for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 17:19:42 +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 1q0QF3-0000U4-MX for pgsql-hackers@lists.postgresql.org; Sat, 20 May 2023 17:19:41 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q0QEv-000sh6-U3 for pgsql-hackers@postgresql.org; Sat, 20 May 2023 17:19:40 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2533ed4f1dcso3062791a91.1 for ; Sat, 20 May 2023 10:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1684603173; x=1687195173; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=gfXp0IHaB20VWRjaDk912ourWXE2oq/QjwjypDsG50E=; b=obNWzf91rCxXpTVldMgMLiRlh0R3BEqewl4G+C+hlE7TbzCrFV33QpIt750Z8g2lpv v9N9fNoqT4rKxd0vdJfFrI6+tdXLCYr2UH1PPXj7hnkWwoMVIDIKks9n9as6MZwP9Y45 A+8K73RhtSyvCYaXvr2m1wCTMLieUUD5cOWPHl3gbK1/lV+nQ92oJyJ1baEAXqNedGL6 dnu/0j4dUEyT8P7SI1zS0mFa84w0oG5G5eodHZOTLoOqcrnYeSKPVv6PN6kgxiyisNxh tdmW2HtEwqkvtFmVr/QpUYyw9opqu9CrhY0FzXU6O50q7APgb2rfSGqZQ65FQdF/CTJJ 8ecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684603173; x=1687195173; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gfXp0IHaB20VWRjaDk912ourWXE2oq/QjwjypDsG50E=; b=Ex9XXBXjGr4aU8w12GQvuz8hTJDUNX3qqr38MT1hS/qIdAu67pDEtOyug9VCimThf4 +n4tDA0DyQ8mYYQEbqpk6r872QXMtIobHifcLTUbIC0qdIcUK6CQADdiGOZRIAJrkjwm z1hYH3PDa2/hoEOaGq8PxKUiMBCmPLd0lU7ppSs94/xODLQap4iiHJroK9680WvKe7To eYqQ25TT5Ua6SdGS6uupU5b30MUecacovWq1C8d8tPIWfvs9bBrxSAfER+ySEnzxQahP l0CRrgjfQ31k0qxmzFlhmpn98evUv58uqycwxvju1in6x5FHx9lLuhDwN0Ng2h+9g83U jUsg== X-Gm-Message-State: AC+VfDxdMawCeou6m/1zu3CTMqRDW3M4INyLP/ZOh79xhIP9Lj8lZAaa GLe0X8wdtOAbwve6mUSkpY+1yQ== X-Google-Smtp-Source: ACHHUZ6hFurT34EvQoGfrJO1VYlt/9vlujxN4OEo9aQDPhJfqiUhCJubpPQzY+27J15XsncWE0enOg== X-Received: by 2002:a17:90b:1e06:b0:24e:2d3:a404 with SMTP id pg6-20020a17090b1e0600b0024e02d3a404mr5780859pjb.4.1684603172824; Sat, 20 May 2023 10:19:32 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id s31-20020a17090a69a200b0023a9564763bsm3537152pjj.29.2023.05.20.10.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 10:19:32 -0700 (PDT) Message-ID: <423180d32bd2e9a61b839aff0dfefa1655d2fc1f.camel@j-davis.com> Subject: Re: ICU locale validation / canonicalization From: Jeff Davis To: Noah Misch , Peter Eisentraut Cc: Robert Haas , pgsql-hackers@postgresql.org Date: Sat, 20 May 2023 10:19:30 -0700 In-Reply-To: <20230502142938.GA2432446@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> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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? > >=20 > > I say, let's do it. >=20 > 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.=C2=A0 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.=C2=A0 Most-affected > were > installcheck runs, which rose from 11m to 19m.=C2=A0 (The "check" stage > uses > NO_LOCALE=3D1, so it changed less.)=C2=A0 From profiles, my theory is tha= t > 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=3Dund.