Re-introduced in version 5.5.5 of Hamsters.js, Memoize is an optional parameter which enabled the caching of your Hamsters.js function calls,
meaning on initial runs of your function Hamsters.js will make use of multiple web workers for parallel processing and then cache the results, then on subsequent runs,
assuming the input data is the same as before. The result will be fetched from the cache eliminating the need to process the function again.
Memoization, a concept in computer science, involves caching results to optimize system resource usage and return cached results. It helps improve performance by storing the results of expensive function calls and retrieving them when the same inputs occur again, reducing redundant computations. Learn More
The way cached data is stored is different depending on the environment Hamsters.js is running in, when running in a Web Environment the results are stored using IndexedDB.
When running in Node.js the cached data is stored in an in memory data store, and is not persisted after reboots or powerloss.
You can make use of memoization by adding an extra memoize: true to your params object.