diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-10-21 15:14:15 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-10-21 15:14:15 (GMT) |
commit | 2bfbf4f707415774e17d160e626a5e11ff8d8d61 (patch) | |
tree | ac6ba5031c7e2774442953f750e356f8f3e7ae94 /src/H5Distore.c | |
parent | bf5d98d7b9018c03e947422dc6f43e76feeca2b0 (diff) | |
download | hdf5-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/H5Distore.c')
-rw-r--r-- | src/H5Distore.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index fc78c89..49311f5 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.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]; |