summaryrefslogtreecommitdiff
path: root/mysys/my_static.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-07-20 19:26:31 +0300
committerMonty <monty@mariadb.org>2020-07-23 10:54:33 +0300
commitdbcd3384e0799ee99a966edaff2c0f135ef51a29 (patch)
tree9beee5052a706dd721c044edf0de971f868d15e3 /mysys/my_static.c
parent46ffd47f422147cd748119eba19ad248bd7356db (diff)
downloadmariadb-git-dbcd3384e0799ee99a966edaff2c0f135ef51a29.tar.gz
MDEV-7947 strcmp() takes 0.37% in OLTP RO
This patch ensures that all identical character sets shares the same cs->csname. This allows us to replace strcmp() in my_charset_same() with comparisons of pointers. This fixes a long standing performance issue that could cause as strcmp() for every item sent trough the protocol class to the end user. One consequence of this patch is that we don't allow one to add a character definition in the Index.xml file that changes the csname of an existing character set. This is by design as changing character set names of existing ones is extremely dangerous, especially as some storage engines just records character set numbers. As we now have a hash over character set's csname, we can in the future use that for faster access to a specific character set. This could be done by changing the hash to non unique and use the hash to find the next character set with same csname.
Diffstat (limited to 'mysys/my_static.c')
-rw-r--r--mysys/my_static.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c
index cb0465929ab..6c09ab8d94b 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -47,6 +47,7 @@ PSI_memory_key key_memory_my_compress_alloc;
PSI_memory_key key_memory_my_err_head;
PSI_memory_key key_memory_my_file_info;
PSI_memory_key key_memory_pack_frm;
+PSI_memory_key key_memory_charsets;
#ifdef _WIN32
PSI_memory_key key_memory_win_SECURITY_ATTRIBUTES;