Open
Description
Currently in code we have functions that work with a lot of data (e.g. events - groupEventsByExecutionEnv
) which are called multiple times per execution. Most of the time this functions are called with the same data leading to duplicated computations.
It would be nice to memoize the return values for specific call parameters. This can be done via Map
, preferably a WeakMap
to keep GC working properly.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
The most preferable approach would be to make general memoize
util function which works for any function.