Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24754

Modified Files:
      Tag: MonetDB_1-20
        gdk_atoms.mx 
Log Message:
Reverted change to string hash function.  This reversal will not be
propagated to the head branch.

Given that we are planning to do a new feature release within a few
months which is definitely not going to be backward compatible, and
given that this change is the only one that would make this release
backward incompatible (at the database level), and given that this
change is "only" a performance fix, and given that the performance
gained is less than a factor two in the best possible scenario which
is somewhat contrived, and given that this fix was a response to (not
a fix for) a bug report which was submitted after the first release
candidate had already been built, and given that the old string hash
has been around for probably at least a decade (the last change to the
code was 2004 for 64 bit builds, and before that in 2000) and nobody
has found it important enough to fix its (known) performance issues
until in the middle of a release cycle, and given that there is no
time to do a backward compatibility fix for those who have (sometimes
large) databases around, I have decided, with the powers vested in me
as Release Manager, to revert this change.


Index: gdk_atoms.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_atoms.mx,v
retrieving revision 1.134.6.1
retrieving revision 1.134.6.2
diff -u -d -r1.134.6.1 -r1.134.6.2
--- gdk_atoms.mx        14 Oct 2007 20:31:32 -0000      1.134.6.1
+++ gdk_atoms.mx        17 Oct 2007 11:42:38 -0000      1.134.6.2
@@ -1878,19 +1878,13 @@
 rotates all characters together. It is optimized to process 2 characters
 at a time (adding 16-bits to the hash value each iteration).
 @h
-#define GDK_STRHASH(x,y) {\
-     str _key = (str) (x);\
-     int _i;\
-     for (_i = y = 0; _key[_i]; _i++) {\
-         y += _key[_i];\
-         y += (y << 10);\
-         y ^= (y >> 6);\
-     }\
-     y += (y << 3);\
-     y ^= (y >> 11);\
-     y += (y << 15);\
+#define GDK_STRHASH(x,y) {                                             \
+        str _c = (str) (x);                                            \
+        for((y)=0; _c[0] && _c[1]; _c+=2) {                            \
+                 (y) = ((y) << 3) ^ ((y) >> 11) ^ ((y) >> 17) ^ (_c[1] << 8) ^ 
_c[0];\
+        }                                                              \
+        (y) ^= _c[0];                                                  \
 }
-
 @c
 hash_t
 strHash(str s)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to