[erlang-questions] mochiglobal vs ets vs registered process

Bob Ippolito <>
Tue May 22 21:06:54 CEST 2012


On Tue, May 22, 2012 at 11:55 AM, Tomasz Maciejewski <>wrote:

> Dnia 22-05-2012 o 20:39:23 Garrett Smith <> napisał(a):
>
>
>  The test was to simply read a "global" value 1M times, after having
>> first initialized the facility. Times are of the "run" portion only
>> and do not include the "init" time.
>>
>
> I see your test reading 1M times *the same* value. I'd rather see the test
> when you write and read 1M random keys/values. The single value could be
> cached spoiling the test.


mochiglobal is unsuitable for writes at runtime, at least prior to R16,
because loading new code blocks the whole VM (possibly for *seconds*). The
(only) occasion where you'll see mochiglobal work better than ets is when
you have a very large data structure that you need to read at runtime with
high process concurrency. The goal is to share memory and avoid garbage
collector churn. In the tests the given value is so small AND you're only
reading it from one process, so of course that there's no benefit.

-bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120522/8457344d/attachment.html>


More information about the erlang-questions mailing list