diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-03-21 09:55:48 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-03-21 09:55:48 +0100 |
commit | 07de9ab7fcfcc004eb30d8b5254a5981af3cf5ab (patch) | |
tree | 7da562f5b0a32d8c6e3e347c66ea0682732dbfe5 /strings | |
parent | 9a04194428324a446b2662a160e89aa663549dfb (diff) | |
download | mariadb-git-07de9ab7fcfcc004eb30d8b5254a5981af3cf5ab.tar.gz |
Few simple performance fixes found with sysbench oltp.lua and Oprofile:
- Avoid needless load/stores in my_hash_sort_simple due to possible aliasing
- Avoid expensive Join_plan_state constructor in choose_subquery_plan when no subquery
- Avoid calling update_virtual_fields for every row when no virtual fields.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index e60f9307e39..e25c0783abf 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -306,19 +306,24 @@ void my_hash_sort_simple(CHARSET_INFO *cs, { register const uchar *sort_order=cs->sort_order; const uchar *end; + ulong n1, n2; /* Remove end space. We have to do this to be able to compare 'A ' and 'A' as identical */ end= skip_trailing_space(key, len); - + + n1= *nr1; + n2= *nr2; for (; key < (uchar*) end ; key++) { - nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * - ((uint) sort_order[(uint) *key])) + (nr1[0] << 8); - nr2[0]+=3; + n1^=(ulong) ((((uint) n1 & 63)+n2) * + ((uint) sort_order[(uint) *key])) + (n1 << 8); + n2+=3; } + *nr1= n1; + *nr2= n2; } |