Issue991

Title Reuse/reserve vector for applicable operators in eager search
Priority wish Status chatting
Superseder Nosy List florian, jendrik, malte, silvan
Assigned To Keywords
Optional summary

Created on 2021-01-22.13:46:15 by florian, last changed by silvan.

Messages
msg9798 (view) Author: malte Date: 2021-01-22.14:23:37
I would advise against reserving using some kind of guess. We don't really know what to guess, and we would still need one dynamic memory allocation per call. The other alternative, recycling the vector, doesn't require guessing and means there will be 0 allocations per call eventually. It may also give us better locality of memory access.


The number of reallocations that Florian mentioned will depend on the task. Our data was for miconic-strips task 8-4, using the astar(blind()) configuration.

Relatedly, one of the next largest callers of "operator new" in this experiment was the EvaluationContext cache. Recycling objects could also be useful for the evaluation context.

We gathered this data by looking at the callers and number of calls of operator new/delete with callgrind. This was quite interesting in general and it could perhaps be useful to identify a few other optimization opportunities there.
msg9797 (view) Author: florian Date: 2021-01-22.13:46:15
While investigating issue348, we saw that a significant part of the dynamic memory allocations in our code come from reallocating the vector of applicable operators (see msg9794). The vector is reallocated roughly 5 times during its life.

In this issue we want to try to either use reserve with a reasonable size or to reuse the complete vector from one expansion to the next. This should improve the speed of eager search by a small amount.
History
Date User Action Args
2021-01-25 08:50:22silvansetnosy: + silvan
2021-01-22 14:23:37maltesetstatus: unread -> chatting
messages: + msg9798
2021-01-22 13:46:15floriancreate