If we want to save some outputs of the function, we often use the memoization pattern as follows,
If I call this function many times for different arguments, Mathematica has to first find the best pattern defined so far i.e., choose the right overload. Is there any performance guarantee if there are $N$ overloaded functions in terms time complexity? As we now have
Association, we have another natural way to memoize even though using
Association looks uglier. I also want to know which way is more efficient given that there are $N$ overloaded functions with the same name.