Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:6
-
Epic Link:
-
Team:Data Release Production
Description
A recent discussion with John Parejko relayed a comment from Pierre Astier to the effect that at least some of the performance problems in reading afw.table files is due to a lot of time spent in malloc. I have a guess at where that is happening - in the creation of shared_ptrs for all of the records - and if that's correct, an idea for how to possibly fix it without breaking anything (by allocating extra space for the Record object in the larger block allocated by the table that actually holds the data, and then using std::allocate_shared to avoid a heap allocation when constructing the shared pointer.
That still uses the same amount of total memory, so unless it reduces fragmentation in a subtle way, it's unlikely to address DM-15578 - and the existence of that issue makes me think there must be something else quite wasteful going on, even if I'm right that we could avoid some malloc calls with the proposal above.
John Parejko, Paul Price, Eli Rykoff: if any of your recent profiling produced data that could confirm or reject this hypothesis, please let me know. Otherwise I'll try to profile this myself and put together a fix if I'm right, but I'm afraid I can't put this at the top of my priority list right now.
Total time to read the catalog, which always contained 10k rows. I was only interested in how the minimum time for each record size shifted around, so it was actually nice not to normalize them so the lines didn't lie on top of each other.
I'm rerunning now with 50k records to make sure I'm not hitting small numbers of chunks for the larger nRowsToPrep values.