pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Alexander Borisov <lex.borisov@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve the performance of Unicode Normalization Forms.
Date: Thu, 19 Jun 2025 10:41:57 -0700
Message-ID: <4211ffd7fe154c4af693b98d78f4a3689ce8cc30.camel@j-davis.com> (raw)
In-Reply-To: <844d3dd7-2955-4794-95d1-7f4c13cb89fc@gmail.com>
References: <844d3dd7-2955-4794-95d1-7f4c13cb89fc@gmail.com>

On Tue, 2025-06-03 at 00:51 +0300, Alexander Borisov wrote:
> As promised, I continue to improve/speed up Unicode in Postgres.
> Last time, we improved the lower(), upper(), and casefold()
> functions. [1]
> Now it's time for Unicode Normalization Forms, specifically
> the normalize() function.

Did you compare against other implementations, such as ICU's
normalization functions? There's also a rust crate here:

https://github.com/unicode-rs/unicode-normalization

that might have been optimized.

In addition to the lookups themselves, there are other opportunities
for optimization as well, such as:

* reducing the need for palloc and extra buffers, perhaps by using
buffers on the stack for small strings

* operate more directly on UTF-8 data rather than decoding and re-
encoding the entire string

Regards,
	Jeff Davis






view thread (45+ messages)  latest in thread

Message-ID: <4211ffd7fe154c4af693b98d78f4a3689ce8cc30.camel@j-davis.com>
Permalink:  ../4211ffd7fe154c4af693b98d78f4a3689ce8cc30.camel@j-davis.com/
Also on:    postgresql.org/message-id/4211ffd7fe154c4af693b98d78f4a3689ce8cc30.camel@j-davis.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pgsql@j-davis.com, lex.borisov@gmail.com
  Subject: Re: Improve the performance of Unicode Normalization Forms.
  In-Reply-To: <4211ffd7fe154c4af693b98d78f4a3689ce8cc30.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