Open Credo

1 item found: Search results for "memoization" in all categories x

Lambda memoization in Java 8

August 19, 2015 | Software Consultancy

Lambda memoization in Java 8

Memoization is a technique whereby we trade memory for execution speed. Suppose you have a function which

  • Is costly to execute.
  • Always returns the same output for the same input.
  • May be called many times with the same input.

In this scenario, it may make sense to “remember” the output returned for each distinct input in a hash map, and replace function execution with a lookup in the hash map.

Read More Read More