summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-02-05 04:30:48 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-02-05 04:30:48 (GMT)
commit7f718e9ea232a84ec2be1b52f25f152de775fdac (patch)
tree0d2fdf5a717cf0a4ca8781a40e0fa467ddd88e7b /src/H5AC.c
parent08001e2f3f17b17889fae655a6ed6cef7747d729 (diff)
downloadhdf5-7f718e9ea232a84ec2be1b52f25f152de775fdac.zip
hdf5-7f718e9ea232a84ec2be1b52f25f152de775fdac.tar.gz
hdf5-7f718e9ea232a84ec2be1b52f25f152de775fdac.tar.bz2
There is performance issue when closing an object. The slow down is due to the search of
the "tag_list" to find out the "corked" status of an object. The fix: (1) Add a counter "num_objs_corked" in the cache structure to track the number of "corked" objects. (2) Skip the search of "tag_list" if the counter is zero i.e. no "corked" objects.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index e1838fb..4801194 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -2403,8 +2403,13 @@ H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked)
HDassert(H5F_addr_defined(obj_addr));
HDassert(action == H5AC__SET_CORK || action == H5AC__UNCORK || action == H5AC__GET_CORKED);
- if(action == H5AC__GET_CORKED)
- HDassert(corked);
+ if(action == H5AC__GET_CORKED) {
+ HDassert(corked);
+ if(H5C_get_num_objs_corked(f->shared->cache) == 0) {
+ *corked = FALSE;
+ HGOTO_DONE(SUCCEED)
+ }
+ }
if(H5C_cork(f->shared->cache, obj_addr, action, corked) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Cannot perform the cork action")