diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-01 03:29:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-01 03:29:00 (GMT) |
commit | 4f0b880861c6d719ef30302ebc522abdaf84b292 (patch) | |
tree | 15cd04cb350ccb916cd393dd2d19c54ab6997b77 /src/H5D.c | |
parent | a4281bd2f22a871fb9a5f7d5b0180f19efc3c73d (diff) | |
download | hdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.zip hdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.tar.gz hdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.tar.bz2 |
[svn-r8456] Purpose:
Code optimization
Description:
Eliminate more 64-bit multiplies by remebering the size of contiguous
datasets as well as chunked datasets.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.9 (sleipnir)
too minor to require h5committest
Diffstat (limited to 'src/H5D.c')
-rw-r--r-- | src/H5D.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2073,6 +2073,10 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space } else if (ndims>0 && max_dim[0]>new_dset->layout.dim[0]) { HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL, "extendible contiguous non-external dataset") } + + /* Compute the total size of a chunk */ + for (u=1, new_dset->layout.chunk_size=new_dset->layout.dim[0]; u<new_dset->layout.ndims; u++) + new_dset->layout.chunk_size *= new_dset->layout.dim[u]; break; case H5D_CHUNKED: @@ -2104,7 +2108,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space new_dset->layout.dim[u] = chunk_size[u]; /* Compute the total size of a chunk */ - for (u=0, new_dset->layout.chunk_size=1; u<new_dset->layout.ndims; u++) + for (u=1, new_dset->layout.chunk_size=new_dset->layout.dim[0]; u<new_dset->layout.ndims; u++) new_dset->layout.chunk_size *= new_dset->layout.dim[u]; break; |