diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2019-02-05 04:30:48 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2019-02-05 04:30:48 (GMT) |
commit | 7f718e9ea232a84ec2be1b52f25f152de775fdac (patch) | |
tree | 0d2fdf5a717cf0a4ca8781a40e0fa467ddd88e7b /src/H5C.c | |
parent | 08001e2f3f17b17889fae655a6ed6cef7747d729 (diff) | |
download | hdf5-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/H5C.c')
-rw-r--r-- | src/H5C.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -327,6 +327,7 @@ H5C_create(size_t max_cache_size, /* Tagging Field Initializations */ cache_ptr->ignore_tags = FALSE; + cache_ptr->num_objs_corked = FALSE; cache_ptr->slist_changed = FALSE; cache_ptr->slist_len = 0; @@ -7729,6 +7730,8 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Set the corked status for the entire object */ tag_info->corked = TRUE; + cache_ptr->num_objs_corked++; + } /* end if */ else { /* Sanity check */ @@ -7740,6 +7743,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Set the corked status for the entire object */ tag_info->corked = FALSE; + cache_ptr->num_objs_corked--; /* Remove the tag info from the tag list, if there's no more entries with this tag */ if(0 == tag_info->entry_cnt) { |