[erlang-questions] Retrieving "semi-constant" data from a function versus Mnesia
Wed May 13 01:00:02 CEST 2015
Hi Joe !
Thank you very much for a resolving answer/response indeed !
This is my debut / first ever communication/message-interchange with you by
the way :-)
( but I have been aware of Erlang ....you ..and some of the other
community-active users for a few years now ).
And also ... Thank you way ...way more for your contribution of/to a
language being absolutely marvelously flexible & simplistic to use in real
life prototyping/"testing out"-situations ( it even beats Python in this
regard if you ask me ).
It struck me yesterday that I actually have two other more "generic"
as well .....but which happen to fit in completely naturally & closely
under this current question-thread by their nature .....so I put them here
Are fixed data, defined & compiled inside functions, always stored inside &
referenced from the constant-pool of the particular modules regardless of
what Erlang term-types/structures they holds ....or does it exist special
situations when such fixed data becomes partly or fully copied into the
heap/stack of the calling process ?
In the current web-application project I work with (implemented on top of
Yaws) I have the following type of function-call construct ( to achieve
server-side method-dispatching )
According to the efficiency-guide of the Erlang-documentation this type of
call-construct is more "expensive" (about six times) compare to a fully
fixed name function-call.
In what sense is it more expensive ? ....is it about the time-lag between
the point when the VM catch/discovers this call-construct and the point
when the functional content (the prepared sub-routines) actually can be
Once again ....thank you very much for contributing this language to the
Sending my best regards !
Peter , Lund Sverige
2015-05-11 14:32 GMT+02:00 Joe Armstrong <>:
> On Sun, May 10, 2015 at 10:32 PM, Benoit Chesneau <>
> > On Sun, May 10, 2015 at 10:23 PM Joe Armstrong <> wrote:
> >> How large is the total data?
> >> If it's small you could define this in a module and not use a database
> >> or process at all.
> > How small should it be? What if the compiled bean is about 888 kilobytes?
> It depends :-)
> There are many factors involved:
> a) How much memory do you have
> b) How often do you want to change the configuration data
> c) How quick do you the change to be
> a) is a smallish number of GBytes (normal these days)
> b) is "relatively rarely" (I don't know what this means - (aside - this
> is why
> I always ask people to provide numbers in their questions))
> Say once a day
> c) is a few seconds
> Then it should be perfectly doable. Making a module containing all the
> config data
> and recompiling when necessary is certainly the fastest way to access the
> data -
> this has very fast reads but very slow writes - you could think of a
> module as a database
> optimized for reads but not writes :-)
> > - benoit
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions