postgresql/src/common
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
..
unicode Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
archive.c Move routine building restore_command to src/common/ 2020-03-24 12:13:36 +09:00
base64.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
checksum_helper.c Add checksum helper functions. 2020-04-03 11:52:43 -04:00
config_info.c Simplify passing of configure arguments to pg_config 2020-02-10 19:23:41 +01:00
controldata_utils.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s_full_table.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s_intrinsics.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Rationalize code placement between wchar.c, encnames.c, and mbutils.c. 2020-01-16 18:08:21 -05:00
exec.c Replace remaining StrNCpy() by strlcpy() 2020-08-10 23:20:37 +02:00
f2s.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
fe_memutils.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
file_perm.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
file_utils.c Skip unnecessary stat() calls in walkdir(). 2020-09-07 18:28:06 +12:00
hashfn.c Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
ip.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jsonapi.c Run pgindent with new pg_bsd_indent version 2.1.1. 2020-05-16 11:54:51 -04:00
keywords.c Allow most keywords to be used as column labels without requiring AS. 2020-09-18 16:46:36 -04:00
kwlookup.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
link-canary.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
logging.c Improve common/logging.c's support for multiple verbosity levels. 2020-09-17 12:52:18 -04:00
Makefile Remove logging.c from the shared library of src/common/ 2020-10-01 10:37:34 +09:00
md5.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_get_line.c Rethink API for pg_get_line.c, one more time. 2020-09-22 15:55:13 -04:00
pg_lzcompress.c Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
pgfnames.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
protocol_openssl.c Move OpenSSL routines for min/max protocol setting to src/common/ 2020-01-17 10:06:17 +09:00
psprintf.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
relpath.c Add declaration-level assertions for compile-time checks 2020-02-03 14:48:42 +09:00
restricted_token.c Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
rmtree.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ryu_common.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
saslprep.c Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
scram-common.c Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
sha2_openssl.c Revert "Change SHA2 implementation based on OpenSSL to use EVP digest routines" 2020-09-29 09:25:51 +09:00
sha2.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sprompt.c Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
string.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
stringinfo.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
unicode_norm.c Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
username.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
wait_error.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
wchar.c Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00