summaryrefslogtreecommitdiffstats
path: root/src/H5Fistore.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-10-21 15:14:15 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-10-21 15:14:15 (GMT)
commit2bfbf4f707415774e17d160e626a5e11ff8d8d61 (patch)
treeac6ba5031c7e2774442953f750e356f8f3e7ae94 /src/H5Fistore.c
parentbf5d98d7b9018c03e947422dc6f43e76feeca2b0 (diff)
downloadhdf5-2bfbf4f707415774e17d160e626a5e11ff8d8d61.zip
hdf5-2bfbf4f707415774e17d160e626a5e11ff8d8d61.tar.gz
hdf5-2bfbf4f707415774e17d160e626a5e11ff8d8d61.tar.bz2
[svn-r773] Changes since 19981019
---------------------- ./src/H5Fistore.c Improved the hash function so it mixes bits better. This results in a few percent improvement in raw data chunk cache efficiency because there are fewer collisions. ./test/chunk.c Added #define's for chunk preemption `w0' value and number of slots in cache. ./src/H5B.c Added some more comments to H5B_insert_helper() and H5B_remove_helper() and also point to some additional documentation.
Diffstat (limited to 'src/H5Fistore.c')
-rw-r--r--src/H5Fistore.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index fc78c89..49311f5 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -164,6 +164,18 @@ H5B_class_t H5B_ISTORE[1] = {{
H5F_istore_debug_key, /*debug */
}};
+#define H5F_MIXUP(X) { \
+ (X) += (X)<<12; \
+ (X) ^= (X)>>22; \
+ (X) += (X)<<4; \
+ (X) ^= (X)>>9; \
+ (X) += (X)<<10; \
+ (X) ^= (X)>>2; \
+ (X) += (X)<<7; \
+ (X) ^= (X)>>12; \
+}
+
+
/*-------------------------------------------------------------------------
* Function: H5F_istore_sizeof_rkey
@@ -1187,10 +1199,14 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
FUNC_ENTER (H5F_istore_lock, NULL);
assert(split_ratios);
-
+
if (rdcc->nslots>0) {
idx = layout->addr.offset;
- for (i=0; i<layout->ndims; i++) idx = (idx<<1) ^ offset[i];
+ H5F_MIXUP(idx);
+ for (i=0; i<layout->ndims; i++) {
+ idx += offset[i];
+ H5F_MIXUP(idx);
+ }
idx %= rdcc->nslots;
ent = rdcc->slot[idx];