[erlang-questions] Passing records vs Mnesia lookups

mats cronqvist masse@REDACTED
Mon Apr 27 15:51:40 CEST 2009

Amit Murthy <amit.murthy@REDACTED> writes:

> I don't need transactions, and all the data is only on one node, but as Ulf
> pointed out, wouldn't an ets:lookup also result in a completely new copy of
> the long record and hence, as far as CPU cycles spent in data copying is
> concerned, will be the same as for message passing ?

  Yes, I guess. But you'll avoid the copy when the master process
  reads in the long record.

  Having said that; I find it hard to believe that the differences in
  CPU is significant, or even measurable. Which of course makes all of
  this an exercise in silly micro-optimization.

  So the choice of implementation should be based on whether you want
  to couple the master process to the workers (by sending a message)
  or not.


More information about the erlang-questions mailing list