List:Commits« Previous MessageNext Message »
From:Mikael Ronstrom Date:November 20 2009 5:54pm
Subject:bzr push into mysql-5.6-next-mr branch (mikael:2923 to 2924) WL#5105
View as plain text  
 2924 Mikael Ronstrom	2009-11-20 [merge]
      WL#5105, Optimize ptr_cmp on Solaris by using memcmp instead of native ptr_cmp

    modified:
      mysys/ptr_cmp.c
 2923 Davi Arnaut	2009-11-19 [merge]
      Manual merge of mysql-next-mr-runtime upstream.

    added:
      mysql-test/r/partition_sync.result
      mysql-test/r/rpl_mysqldump_slave.result
      mysql-test/t/partition_sync.test
      mysql-test/t/rpl_mysqldump_slave.test
    modified:
      client/client_priv.h
      client/mysql.cc
      client/mysqladmin.cc
      client/mysqlcheck.c
      client/mysqldump.c
      client/mysqltest.cc
      client/sql_string.cc
      client/sql_string.h
      config/ac-macros/misc.m4
      include/m_string.h
      include/mysql_com.h
      include/violite.h
      libmysql/libmysql.c
      libmysqld/lib_sql.cc
      mysql-test/r/alias.result
      mysql-test/r/delete.result
      mysql-test/r/derived.result
      mysql-test/r/dirty_close.result
      mysql-test/r/func_sapdb.result
      mysql-test/r/func_time.result
      mysql-test/r/mysql.result
      mysql-test/r/sp-error.result
      mysql-test/r/sp.result
      mysql-test/r/trigger.result
      mysql-test/r/type_time.result
      mysql-test/suite/rpl/r/rpl_multi_delete2.result
      mysql-test/suite/rpl/t/rpl_multi_delete2.test
      mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
      mysql-test/t/alias.test
      mysql-test/t/delete.test
      mysql-test/t/derived.test
      mysql-test/t/dirty_close.test
      mysql-test/t/func_sapdb.test
      mysql-test/t/func_time.test
      mysql-test/t/lock_multi.test
      mysql-test/t/mysql.test
      mysql-test/t/shm.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp.test
      mysql-test/t/trigger.test
      mysql-test/t/type_time.test
      mysys/my_alloc.c
      mysys/my_getopt.c
      sql/event_data_objects.cc
      sql/field.cc
      sql/field.h
      sql/ha_partition.cc
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_subselect.cc
      sql/item_timefunc.cc
      sql/mysql_priv.h
      sql/opt_sum.cc
      sql/share/errmsg.txt
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_cache.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_list.h
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_select.cc
      sql/sql_servers.cc
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_string.h
      sql/sql_trigger.cc
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/table.h
      sql/tztime.cc
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      strings/ctype-bin.c
      strings/ctype-latin1.c
      strings/ctype-mb.c
      strings/ctype-simple.c
      vio/vio.c
      vio/vio_priv.h
      vio/viosocket.c
=== modified file 'mysys/ptr_cmp.c'
--- a/mysys/ptr_cmp.c	2007-05-10 09:59:39 +0000
+++ b/mysys/ptr_cmp.c	2009-09-23 13:15:35 +0000
@@ -22,16 +22,39 @@
 #include "mysys_priv.h"
 #include <myisampack.h>
 
+#ifdef UNIV_SOLARIS
+/*
+ * On Solaris, memcmp() is normally faster than the unrolled ptr_compare_N
+ * functions, as memcmp() is usually a platform-specific implementation
+ * written in assembler, provided in /usr/lib/libc/libc_hwcap*.so.1.
+ * This implementation is also usually faster than the built-in memcmp
+ * supplied by GCC, so it is recommended to build with "-fno-builtin-memcmp"
+ * in CFLAGS if building with GCC on Solaris.
+ */
+
+#include <string.h>
+
+static int native_compare(size_t *length, unsigned char **a, unsigned char **b)
+{
+  return memcmp(*a, *b, *length);
+}
+
+#else	/* UNIV_SOLARIS */
+
 static int ptr_compare(size_t *compare_length, uchar **a, uchar **b);
 static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b);
 static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b);
 static int ptr_compare_2(size_t *compare_length, uchar **a, uchar **b);
 static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b);
+#endif	/* UNIV_SOLARIS */
 
 	/* Get a pointer to a optimal byte-compare function for a given size */
 
 qsort2_cmp get_ptr_compare (size_t size)
 {
+#ifdef UNIV_SOLARIS
+  return (qsort2_cmp) native_compare;
+#else
   if (size < 4)
     return (qsort2_cmp) ptr_compare;
   switch (size & 3) {
@@ -41,6 +64,7 @@ qsort2_cmp get_ptr_compare (size_t size)
     case 3: return (qsort2_cmp) ptr_compare_3;
     }
   return 0;					/* Impossible */
+#endif /* UNIV_SOLARIS */
 }
 
 


Attachment: [text/bzr-bundle] bzr/mikael@mysql.com-20091120175356-1d9vzjed701zfv3u.bundle
Thread
bzr push into mysql-5.6-next-mr branch (mikael:2923 to 2924) WL#5105Mikael Ronstrom20 Nov