I’m evaluating the trade-offs and efficient use of memoization with lengthy vectors, particularly in optimisation. Suppose a vector input to an expensive function has many Float64 elements, say, 100,000. When this function is memoized:
Is the whole vector stored or just some ID/ hashcode?
Is the equality with an incoming vector tested by reference or by value? Does this depend on the number of elements?
How can some of the memoized keys/values be deleted programmatically (e.g., by popping a stack)?
How would the above apply if the input vector was the optimisation variable in JuMP?