memorize the results of a multi-parameter function.
since references to object type arguments are held strongly in the memorized function's cache, you will probably want to manage clearing entries manually, using either Map methods, or StrongTree methods.