DefMemo
DefMemo copied to clipboard
Cache improvement
I think using :ets instead of a GenServer with Map.new is a better choice because:
- Concurrency:
:etsallows multiple processes to read and write simultaneously without bottlenecks. - Performance: It provides constant-time lookups and avoids message passing overhead.
- Memory efficiency: Data is stored outside the process heap, reducing GC pressure and improving scalability.
AS backend for https://github.com/os6sense/DefMemo/blob/master/lib/defmemo_result_table_gs.ex
Also, ttl would be nice to have isn't it?