postgresql/src
Michael Paquier 783f0cc64d Improve performance of Unicode {de,re}composition in the backend
This replaces the existing binary search with two perfect hash functions
for the composition and the decomposition in the backend code, at the
cost of slightly-larger binaries there (35kB in libpgcommon_srv.a).  Per
the measurements done, this improves the speed of the recomposition and
decomposition by up to 30~40 times for the NFC and NFKC conversions,
while all other operations get at least 40% faster.  This is not as
"good" as what libicu has, but it closes the gap a lot as per the
feedback from Daniel Verite.

The decomposition table remains the same, getting used for the binary
search in the frontend code, where we care more about the size of the
libraries like libpq over performance as this gets involved only in code
paths related to the SCRAM authentication.  In consequence, note that
the perfect hash function for the recomposition needs to use a new
inverse lookup array back to to the existing decomposition table.

The size of all frontend deliverables remains unchanged, even with
--enable-debug, including libpq.

Author: John Naylor
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/CAFBsxsHUuMFCt6-pU+oG-F1==CmEp8wR+O+bRouXWu6i8kXuqA@mail.gmail.com
2020-10-23 11:05:46 +09:00
..
backend Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
bin Clean up some unpleasant behaviors in psql's \connect command. 2020-10-22 14:04:28 -04:00
common Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
fe_utils Standardize the printf format for st_size 2020-09-24 21:04:21 +02:00
include Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
interfaces Add documentation and tests for quote marks in ECPG literal queries. 2020-10-22 18:29:46 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Fixup some appendStringInfo and appendPQExpBuffer calls 2020-10-15 20:35:17 +13:00
port Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Use croak instead of die in Perl code when appropriate 2020-10-22 13:41:28 +02:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00