persistent_term to replace ETS for caching
Frank Muller <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CAFA6GnBGf7vGtSV7bx+TQ-Mr7Qti7aXdixSZ8ojp+rW34JMQcQ@mail.gmail.com> |
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