Branch: Tag:

2011-05-15

2011-05-15 23:22:45 by Per Hedbor <ph@opera.com>

Changed average hash chain length from 3 to 2. This speeds up string creating in the test (lots of unique strings) by about 20%, and the additional memory usage is not that large. Chainging from 2 to 1 speeds the test up about 4% again, but doubles the overhead for the hashtable.

38:   #define SET_HSIZE(X) htable_mask=(htable_size=(1<<(X)))-1   #define HMODULO(X) ((X) & (htable_mask))    - unsigned INT32 htable_mask; + static unsigned INT32 htable_mask;      #endif   
84:   #endif      #define BEGIN_HASH_SIZE 997 - #define MAX_AVG_LINK_LENGTH 3 + #define MAX_AVG_LINK_LENGTH 2      /* Experimental dynamic hash length */   #ifndef HASH_PREFIX