Use perfect hash for NFC and NFKC Unicode Normalization quick check
Michael Paquier <michael@paquier.xyz>
Use perfect hash for NFC and NFKC Unicode Normalization quick check This makes the normalization quick check about 30% faster for NFC and 50% faster for NFKC than the binary search used previously. The hash lookup reuses the existing array of bit fields used for the binary search to get the quick check property and is generated as part of "make update-unicode" in src/common/unicode/. Author: John Naylor Reviewed-by: Mark Dilger, Michael Paquier Discussion: https://postgr.es/m/CACPNZCt4fbJ0_bGrN5QPt34N4whv=mszM0LMVQdoa2rC9UMRXA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/common/unicode/generate-unicode_normprops_table.pl | modified | +39 −2 |
| src/common/unicode_norm.c | modified | +27 −21 |
| src/include/common/unicode_normprops_table.h | modified | +1609 −1 |
| src/tools/pgindent/exclude_file_patterns | modified | +5 −0 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- speed up unicode normalization quick check 30 messages · 2020-05-21 → 2020-10-21