summaryrefslogtreecommitdiff
path: root/mysys/mysys_priv.h
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/mysys_priv.h
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/mysys_priv.h')
-rw-r--r--mysys/mysys_priv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 5115e0452d5..adf2d39046a 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -87,6 +87,7 @@ extern PSI_memory_key key_memory_my_compress_alloc;
extern PSI_memory_key key_memory_my_err_head;
extern PSI_memory_key key_memory_my_file_info;
extern PSI_memory_key key_memory_pack_frm;
+extern PSI_memory_key key_memory_charsets;
#ifdef _WIN32
extern PSI_memory_key key_memory_win_SECURITY_ATTRIBUTES;