[erlang-questions] dynamic compilation of funs
Wed Apr 25 23:40:56 CEST 2012
Module look-up is a hash table look-up, so assuming correct re-hashing
implementation, it's amortized O(1).
If you're really, really worried, then it would be super simple to just
write the two versions, and benchmark them in isolation, and see if there's
a real difference. My money is on a module-per-function being just fine.
"I pledge allegiance to the flag of the United States of America, and to
the republic for which it stands, one nation indivisible, with liberty and
justice for all."
~ Adopted by U.S. Congress, June 22, 1942
On Tue, Apr 24, 2012 at 1:57 AM, Martin Dimitrov <>wrote:
> That is precisely my concern, the lack of documentation on the subject.
> In our app the number of functions can grow so I am not sure if this is
> the best option.
> Thanks again for the reply.
> On 4/24/2012 11:54 AM, Ulf Wiger wrote:
> > On 24 Apr 2012, at 10:41, Martin Dimitrov wrote:
> >> One more question: would it be inefficient to create a separate module
> >> for each function? I would have about 1000 of them.
> > I do believe the most complex erlang-based systems built have thousands
> of modules.
> > (E.g. the AXD 301 - and GPRS, which is roughly as complex, with more
> than 1M lines of code; I'm not sure what the average module size was, but
> would guess that it was < 1000 LOC).
> > There are no linear operations when addressing modules, except e.g. if
> you decide to list them all.
> > Interestingly, there is no limit mentioned in the Efficiency Guide
> regarding the number of modules. I guess there is no limit then. :)
> > BR,
> > Ulf W
> > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
> > http://feuerlabs.com
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions