Re: persistent_term to replace ETS for caching
Nalin Ranjan <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CACE+zk+YCruu3eQP+t77ko-N1pNCvK3w39peAvm0C-1fgWNK1w@mail.gmail.com> |
It has the potential to trigger Global GC, and can affect responsiveness as per the docs. https://erlang.org/doc/man/persistent_term.html Regards Nalin Ranjan On Sun, Dec 6, 2020 at 5:16 AM Frank Muller <[email protected]> wrote: > Hi guys, > > At work, we cache about 5.3 million entries in ETS. The system works > perfectly, no issue so far (many years). > > During a brainstorming session, a colleague suggested to switch to > persistent_term instead to avoid ETS term copying. > > Pretty simple: we check if the Key exists in persistent_term. If yes, we > are done. If not, we get it from ETS, move it to persistent_term and send > it back to the caller. > > Question: is there any limitation(s) on persistent_term usage? Stated > otherwise, can we create 5.3 million persistent_term <K,V>? > > Any suggestion/idea/thought is very welcome. > > /Frank >