Skip to content
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

Revert "Memoize entity encoding" #187

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Mar 11, 2021

This reverts commit f5bae9e.

Because we cannot forsee the length and amount of strings we need to be more careful about keeping them around as memory consumption can grow unbounded. In the future we should check if we can use a limited cache, only cache attributes or something else. WeakMaps unfortunately won't help as they cannot be used with primitives as cache key.

Got notified privately that a production site ran into a memory leak and we definitely don't want that. Let this be a lesson for myself to be sceptical of memoization, despite it being an easy way to improve benchmark scores!

This reverts commit f5bae9e.

Because we cannot forsee the length and amount of strings we need to
be more careful about keeping them around as memory consumption
can grow unbounded. In the future we should check if we can use
a limited cache, only cache attributes or something else. WeakMaps
unfortunately won't help as they cannot be used with primitives as
cache key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant