Actually no need for tradeoffs: there's a very simple solution to memoization here. Though not functional.