Meyer, OO and concurrency

Bjorn Gustavsson bjorn@REDACTED
Mon Aug 1 14:32:16 CEST 2005


"Richard A. O'Keefe" <ok@REDACTED> writes:

> Perhaps more interesting, the book provides NO PERFORMANCE GUARANTEES.
> Nor can I find any discussion of performance in the on-line documentation
> at www.erlang.se.  For all we are told to the contrary, the process
> dictionary might use linear search or worse.  For example, in Prolog,
> the 'recorded' data base only uses the principal functor of the key for
> indexing, and if Erlang did the same, then using keys a..z would be
> efficient but keys {a}..{z} would be inefficient.  Nor are we advised
> how much copying gets done.  So we have *NO* idea how to use this
> facility efficiently.
> 

The process dictionary used to be implemented using linear search
ON PURPOSE, to not encourage its use.

> As far as I can tell from a quick scan of erl_process_dict.[ch],
> process dictionaries are some kind of expanding hash table and hashing
> depends on the whole key.  They should be pretty good, BUT the fact
> remains that this is not actually promised anywhere that I can find,
> and there are still issues about copying.

Some customer requested that we should make the process dictionary more
efficient, and so we did.

> 
> While I personally think that functional languages are better off without
> assignment statements (unless 'tamed' by an effects system), you don't have
> to agree with me about that to accept that the criticisms I have put forward
> in this message show that the process dictionary, as currently defined, is
> not as good an interface as it should have been, and is risky enough to
> avoid unless you have a REALLY good reason to use it.
> 

It is too late to change the interface, unfortunately.

/Bjorn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list