summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-01-06 17:01:19 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-01-06 17:01:19 (GMT)
commit4e07c6496f6390551b5acb69826a16788ccdf488 (patch)
tree6fe1ed895e147b476de776b71b064237b4fab941
parentb31fee056a8c4a97b9e31a69188f70524558727b (diff)
downloadhdf5-4e07c6496f6390551b5acb69826a16788ccdf488.zip
hdf5-4e07c6496f6390551b5acb69826a16788ccdf488.tar.gz
hdf5-4e07c6496f6390551b5acb69826a16788ccdf488.tar.bz2
[svn-r1932] Reversed the order that hyperslab blocks are added to the internal list of
block to reduce amount of memory moving required. This corrects the exponential increase in time to add blocks for larger numbers of blocks.
-rw-r--r--src/H5Sselect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 5b751c1..9f9e33b 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -304,7 +304,8 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Step through all the blocks to add */
/* (reuse the count in ACC above) */
- for(i=0; i<(int)acc; i++) {
+ /* Adding the blocks in reverse order reduces the time spent moving memory around in H5S_hyper_add() */
+ for(i=(int)acc-1; i>=0; i--) {
/* Build the location of the block */
for(j=0; j<space->extent.u.simple.rank; j++)
slab[j]=start[j]+((i/slice[j])%count[j])*stride[j];