DefMemo icon indicating copy to clipboard operation
DefMemo copied to clipboard

Cache improvement

Open sonic182 opened this issue 1 month ago • 0 comments

I think using :ets instead of a GenServer with Map.new is a better choice because:

  • Concurrency: :ets allows 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?

sonic182 avatar Nov 12 '25 12:11 sonic182