Module look-up is a hash table look-up, so assuming correct re-hashing implementation, it's amortized O(1).<div><br></div><div>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.</div>
<div><br><br><br>Sincerely,<br><br>Jon Watte<br><br><br>--<br>"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."<br>
~ Adopted by U.S. Congress, June 22, 1942<br><br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 24, 2012 at 1:57 AM, Martin Dimitrov <span dir="ltr"><<a href="mailto:mrtndimitrov@gmail.com" target="_blank">mrtndimitrov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That is precisely my concern, the lack of documentation on the subject.<br>
In our app the number of functions can grow so I am not sure if this is<br>
the best option.<br>
<br>
Thanks again for the reply.<br>
<span class="HOEnZb"><font color="#888888"><br>
Martin<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 4/24/2012 11:54 AM, Ulf Wiger wrote:<br>
> On 24 Apr 2012, at 10:41, Martin Dimitrov wrote:<br>
><br>
>> One more question: would it be inefficient to create a separate module<br>
>> for each function? I would have about 1000 of them.<br>
> I do believe the most complex erlang-based systems built have thousands of modules.<br>
><br>
> (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).<br>
><br>
> There are no linear operations when addressing modules, except e.g. if you decide to list them all.<br>
><br>
> Interestingly, there is no limit mentioned in the Efficiency Guide regarding the number of modules. I guess there is no limit then. :)<br>
><br>
> BR,<br>
> Ulf W<br>
><br>
> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.<br>
> <a href="http://feuerlabs.com" target="_blank">http://feuerlabs.com</a><br>
><br>
><br>
><br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div>