[erlang-questions] Re: Best way to implement a simple cache

Scott Lystig Fritchie fritchie@REDACTED
Fri Nov 13 01:36:44 CET 2009


Thijs <thijsterlouw@REDACTED> wrote:

> A process-approach suffers from sequential access. This might not be
> so important since lookups can be very fast, but worth keeping in
> mind. A public/protected ETS table with one owning manager-process
> doesn't suffer from this problem.

... except that public/protected ETS table access isn't free, either.
The VM has to play games with controlling multi-scheduler access to
ETS's underlying hash table/binary tree.  I haven't measured with an
R13B release, but with R12B-5 the cost was definitely non-zero and
significant enough for us to change implementation in one case.

-Scott


More information about the erlang-questions mailing list