Is there any research on quantifying the cost of a procedure, with regard to compiler optimization?
I.e. assigning some kind of cost in terms of CPU time or memory to a procedure, either so the programmer can decide wether the operation, forexample a precomputation, is worth doing, or to help a compiler make optimizing decisions.
I would assume any non-trivial precise costing would be undecidable due to Rice's Theorem, but there could be good heuristics - a more systematic and formal form of the analysis programmers makes themselves.