Re: speed up unicode normalization quick check

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: speed up unicode normalization quick check
Date: 2020-10-08 08:52:18
Message-ID: CAFBsxsGpmuEqd1RvZqMrVg6Q8g3j53XdLSc9EWDyoD2WSVdK9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 8, 2020 at 2:48 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Wed, Oct 07, 2020 at 03:18:44PM +0900, Michael Paquier wrote:
> I looked at this one again today, and applied it. I looked at what
> MSVC compiler was able to do in terms of optimizationswith
> shift-and-add for multipliers, and it is by far not as good as gcc or
> clang, applying imul for basically all the primes we could use for the
> perfect hash generation.
>

Thanks for picking this up! As I recall, godbolt.org also showed MSVC
unable to do this optimization.

> > I have tested 0002 and 0003, that had better be merged together at the
> > end, and I can see performance improvements with MSVC and gcc similar
> > to what is being reported upthread, with 20~30% gains for simple
> > data sample using IS NFC/NFKC. That's cool.
>
> For these two, I have merged both together and did some adjustments as
> per the attached. Not many tweaks, mainly some more comments for the
> unicode header files as the number of structures generated gets
> higher.

Looks fine overall, but one minor nit: I'm curious why you made a separate
section in the pgindent exclusions. The style in that file seems to be one
comment per category.

--
John Naylor

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-10-08 08:59:25 Re: Resetting spilled txn statistics in pg_stat_replication
Previous Message Dilip Kumar 2020-10-08 08:47:40 Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables