summaryrefslogtreecommitdiff
path: root/mysys/thr_mutex.c
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-03-06 16:19:12 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-03-06 16:19:12 +0400
commitb95c8ce530cbbd92b232324dc2c4376615bd1b5d (patch)
tree60222ef1542c97949e24dcbc4474f5484b86119b /mysys/thr_mutex.c
parentae87e63184a451cd0c9cf95f11f51b78bb40fbc3 (diff)
downloadmariadb-git-b95c8ce530cbbd92b232324dc2c4376615bd1b5d.tar.gz
MDEV-5675 - Performance: my_hash_sort_bin is called too often
Reduced number of my_hash_sort_bin() calls from 4 to 1 per query. Reduced number of memory accesses done by my_hash_sort_bin(). Details: - let MDL subsystem use pre-calculated hash value for hash inserts and deletes - let table cache use pre-calculated MDL hash value - MDL namespace is excluded from hash value calculation, so that hash value can be used by table cache as is - hash value for MDL is calculated as resulting hash value + MDL namespace - extended hash implementation to accept user defined hash function
Diffstat (limited to 'mysys/thr_mutex.c')
-rw-r--r--mysys/thr_mutex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index c70aa342802..18af5f47b10 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -174,12 +174,12 @@ static int safe_mutex_lazy_init_deadlock_detection(safe_mutex_t *mp)
128,
offsetof(safe_mutex_deadlock_t, id),
sizeof(mp->id),
- 0, 0, HASH_UNIQUE);
+ 0, 0, 0, HASH_UNIQUE);
my_hash_init2(mp->used_mutex, 64, &my_charset_bin,
128,
offsetof(safe_mutex_t, id),
sizeof(mp->id),
- 0, 0, HASH_UNIQUE);
+ 0, 0, 0, HASH_UNIQUE);
return 0;
}