Introduce a cost interface which determines whether internalizing a function is worthwhile.
Make the names more descriptive and add plenty doxygen documentation for all of them. Maybe put them all in a struct so the user could modify the values by changing the struct members.
I somehow think the method called here should be "shouldInternalize" or something. The problem here is that it "looks" like we internalize if there is an associated cost, e.g., the cost is not zero.
- Cache the InternalizeCost for every function
What I am thinking is that we need to calculate the cost after all dependencies between
AAs become clear. So I think we need to do the cost analysis after the fix point
iteration (or after the first update is done).
Sure, I will add docs once I figure out the when to do such cost analysis and what
There is no need for dynamic allocation here. Let's just return a value, it's only 16 bytes on most systems so easy to copy and with the advantage that we don't leak memory ;)