Skip to content

Memoize computationally expensive calls #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FranjoMindek opened this issue Apr 10, 2025 · 0 comments
Open

Memoize computationally expensive calls #43

FranjoMindek opened this issue Apr 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@FranjoMindek
Copy link
Contributor

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.

@FranjoMindek FranjoMindek added the enhancement New feature or request label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant