Improve performance of averaged importance by using memoization.