diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2020-08-21 16:17:55 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-08-23 09:57:45 +0200 |
commit | cbc3962b937315ccfb0108a6a96ee005328f467c (patch) | |
tree | bdd963f2a79d509a0f80ffa42e29807857de0de5 /deflate.h | |
parent | e7bb6db09a183807a8f94a8bdcf156a765402d9f (diff) |
Increase hash table size from 15 to 16 bits.
This gives a good performance increase, and usually also improves compression.
Make separate define HASH_SLIDE for fallback version of UPDATE_HASH.
Diffstat (limited to 'deflate.h')
-rw-r--r-- | deflate.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -68,9 +68,9 @@ #define FINISH_STATE 666 /* stream complete */ /* Stream status */ -#define HASH_BITS 15 /* log2(HASH_SIZE) */ -#define HASH_SIZE 32768 /* number of elements in hash table */ -#define HASH_MASK 0x7FFF /* HASH_SIZE-1 */ +#define HASH_BITS 16u /* log2(HASH_SIZE) */ +#define HASH_SIZE 65536u /* number of elements in hash table */ +#define HASH_MASK (HASH_SIZE - 1u) /* HASH_SIZE-1 */ /* Data structure describing a single value and its code string. */ |