summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-06 16:14:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-06 16:14:12 (GMT)
commit1a867ef2db84d89938e08dbfd7e86bbd1fa2d7f7 (patch)
treef54d25efd3aacc7514117a1503d9f89507b601e1 /src/H5Shyper.c
parent394dace97be91c6b4a5d1dc23538cc2c12566fb8 (diff)
downloadhdf5-1a867ef2db84d89938e08dbfd7e86bbd1fa2d7f7.zip
hdf5-1a867ef2db84d89938e08dbfd7e86bbd1fa2d7f7.tar.gz
hdf5-1a867ef2db84d89938e08dbfd7e86bbd1fa2d7f7.tar.bz2
[svn-r8305] Purpose:
Code optimization Description: Minor tweaks on the optimized offset/length sequence generator to improve performance by reducing the number of 64-bit multiplies and calls to memcpy(). Platforms tested: Solaris 2.7 (arabica) too minor to require h5committest
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index b6b3d2f..6bca0f7 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -7265,8 +7265,8 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
mem_size[ndims]=elmt_size;
/* initialize row sizes for each dimension */
- for(i=(ndims-1),acc=1; i>=0; i--) {
- slab[i]=acc*elmt_size;
+ for(i=(ndims-1),acc=elmt_size; i>=0; i--) {
+ slab[i]=acc;
acc*=mem_size[i];
} /* end for */
@@ -7323,12 +7323,11 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
nelmts=io_left;
/* Compute the arrays to perform I/O on */
- /* Copy the location of the point to get */
- HDmemcpy(offset, iter->u.hyp.off,ndims*sizeof(hssize_t));
- /* Add in the selection offset */
+ /* Copy the location of the point to get */
+ /* (Add in the selection offset) */
for(i=0; i<ndims; i++)
- offset[i] += sel_off[i];
+ offset[i] = iter->u.hyp.off[i] + sel_off[i];
/* Compute the current "counts" for this location */
for(i=0; i<ndims; i++) {
@@ -7617,12 +7616,10 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
/* Update the iterator */
- /* Subtract out the selection offset */
- for(i=0; i<ndims; i++)
- offset[i] -= sel_off[i];
-
/* Update the iterator with the location we stopped */
- HDmemcpy(iter->u.hyp.off, offset, ndims*sizeof(hssize_t));
+ /* (Subtract out the selection offset) */
+ for(i=0; i<ndims; i++)
+ iter->u.hyp.off[i] = offset[i] - sel_off[i];
/* Decrement the number of elements left in selection */
iter->elmt_left-=(nelmts-io_left);