Re: speed up unicode normalization quick check

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: speed up unicode normalization quick check
Date: 2020-09-18 19:41:54
Message-ID: 9CC07801-6EC2-4166-8B4F-5B336BC99FCD@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sep 18, 2020, at 9:41 AM, John Naylor <john(dot)naylor(at)2ndquadrant(dot)com> wrote:
>
> Attached is version 4, which excludes the output file from pgindent,
> to match recent commit 74d4608f5. Since it won't be indented again, I
> also tweaked the generator script to match pgindent for the typedef,
> since we don't want to lose what pgindent has fixed already. This last
> part isn't new to v4, but I thought I'd highlight it anyway.

0001 looks ok to me. The change is quite minor. I reviewed it by comparing the assembly generated for perfect hash functions before and after applying the patch.

For 0001, the assembly code generated from the perfect hash functions in src/common/keywords.s and src/pl/plpgsql/src/pl_scanner.s do not appear to differ in any performance significant way. The assembly code generated in src/interfaces/ecpg/preproc/ecpg_keywords.s and src/interfaces/ecpg/preproc/c_keywords.s change enough that I wouldn't try to compare them just by visual inspection.

Compiled using -g -O2

Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I'm attaching the diffs of the old and new assembly files, if anyone cares to look.

Attachment Content-Type Size
assember.diffs application/octet-stream 144.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2020-09-18 20:00:04 Memory allocation abstraction in pgcrypto
Previous Message Tom Lane 2020-09-18 19:31:18 Re: factorial function/phase out postfix operators?