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

Add :persistent_term support #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolfinus
Copy link
Contributor

@dolfinus dolfinus commented Mar 20, 2021

Currently MemoizedVocabulary uses :ets for storing the translations.
But OTP 21.2 provides a new :persistent_term module. It has the same get/put methods like :ets, but significantly improved performance for storing mostly read-only data:
https://erlang.org/doc/man/persistent_term.html

It looks like translations are never changed since booting the application, so this module just perfectly suits for storing them.

Here I've added new config key vocabulary_backend with 2 possible options: :ets (default) and :persistent_term.
If someone will try to use :persitent_term on too old OTP version, an exception will be raised during compilation step.

@dolfinus dolfinus force-pushed the persistent_term branch 3 times, most recently from edab12b to 071cba6 Compare March 21, 2021 11:35
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