summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-06 16:14:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-06 16:14:16 (GMT)
commit6612950317292ab684482b343b6b5551d02a77d4 (patch)
tree67066649897b38ee405839b1d6f7d9294d87c9a2 /src
parent8174e4c28643ba1b7f42fe1b8c5dc9f961aa2e5a (diff)
downloadhdf5-6612950317292ab684482b343b6b5551d02a77d4.zip
hdf5-6612950317292ab684482b343b6b5551d02a77d4.tar.gz
hdf5-6612950317292ab684482b343b6b5551d02a77d4.tar.bz2
[svn-r8306] 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')
-rw-r--r--src/H5Shyper.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 2dd5108..06a27c4 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -7262,8 +7262,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 */
@@ -7320,12 +7320,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++) {
@@ -7677,12 +7676,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);