Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4VsQ-000155-UJ for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2020 20:23:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4VsP-0001I0-9p for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2020 20:23:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4VsO-0001Ht-9V for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2020 20:23:21 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4VsK-0001JW-2q for pgsql-hackers@postgresql.org; Wed, 19 Feb 2020 20:23:19 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0F44F21C57; Wed, 19 Feb 2020 15:23:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 19 Feb 2020 15:23:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=EpFB/w3wG63mdPMCyiHFgt4VElm8Cyen/lK1uUWIc Xk=; b=sykwmizpk/zhP5L5+tPiryv+50X5tTn0Sj5RBYsE48zqr1HVr2bJlkG+R Vs7KWoFF16XTasSB4kY+vYThzuBm0+14Hk1HQix+nLs4ipl9yebj+5LTVjgpbhVN 6XHzCuihHKV9awZ/6dcsNOGs9lKZPyXRxQ6OuBdzI75JgOb8m+SKTWamiAJfhyhe di07AfGxtllx9ZTcJmqwsBJkkI6yPj2h9AodxfDZ4KWI9+F2u0zlqFXPeWnFL3Ip cA3vT1YvhUuzimeXA/TqttUZGRnWUdTC72cmXx4HhcHBL2oAkaWG6elJRXvHRKET iXHjkjbtCKR9+9iZmbC7/WqZSn5EQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkedtgddufeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeelnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuffhomhgrihhnpedvnhguqhhurggurhgrnhhtrdgt ohhmnecukfhppeelfedrvdegfedrudehiedrudeludenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vdhnughquhgrughrrghnthdrtghomh X-ME-Proxy: Received: from april.pezone.net (p5df39cbf.dip0.t-ipconnect.de [93.243.156.191]) by mail.messagingengine.com (Postfix) with ESMTPA id 0FA163280060; Wed, 19 Feb 2020 15:23:12 -0500 (EST) Subject: Re: Unicode normalization SQL functions To: Daniel Verite References: <2c5e8df9-43b8-41fa-88e6-286e8634f00a@manitou-mail.org> Cc: Andreas Karlsson , pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 19 Feb 2020 21:23:12 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2c5e8df9-43b8-41fa-88e6-286e8634f00a@manitou-mail.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-02-17 20:08, Daniel Verite wrote: > Concerning execution speed, there's an excessive CPU usage when > normalizing into NFC or NFKC. Looking at pre-existing code, it looks > like recompose_code() in unicode_norm.c looping over the > UnicodeDecompMain array might be very costly. Yes, this is a known issue and I think room for future optimization work. > Another point is that the ICU-based implementation appears > to be significantly faster in all cases, which makes me wonder > why ICU builds should not just use ICU instead of the PG-core > implementation. That would require linking libpq to ICU (for SASLprep), and in general would either make ICU required or require maintaining multiple implementations. I don't think we're there yet. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services