From 1a867ef2db84d89938e08dbfd7e86bbd1fa2d7f7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 6 Apr 2004 11:14:12 -0500 Subject: [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 --- src/H5Shyper.c | 19 ++++++++----------- 1 file 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; iu.hyp.off[i] + sel_off[i]; /* Compute the current "counts" for this location */ for(i=0; iu.hyp.off, offset, ndims*sizeof(hssize_t)); + /* (Subtract out the selection offset) */ + for(i=0; iu.hyp.off[i] = offset[i] - sel_off[i]; /* Decrement the number of elements left in selection */ iter->elmt_left-=(nelmts-io_left); -- cgit v0.12