mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user