Hi,
Platform:Ubuntu Linux 18.04
HDF version:1.12.0 compiled from source.
I am trying to use compound types writing a field at a time (this is necessary for backwards compatibility with our software).
This works but there is a performance issue which I have narrowed down using a profiler to HDstrcmp() in H5T_cmp() in H5T.c.
The sorting by name happens repeatedly for each write even though the members of the compound type are the same each time.
There is a field called ‘sorted’ in H5T_compnd_t and it gets set to H5T_SORT_VALUE by H5T__sort_value().
So my question is: Would you accept a change to avoid sorting repeatedly? Or would you be willing to implement such a change?
My first attempt (sort them by name initially and don’t sort them in H5T_cmp()) breaks my tests because the order of the members by value seems to be relied upon when writing data. A possible solution is to store the index arrays used for sorting in the compound-specific part of the type and fill them once.
Cheers,
-Tony