"We didn't know what we were doing in language A, so we re-wrote it in language B."<div><br></div><div>However, it IS very easy to run into unexpected performance problems in Erlang. To wit: we just profiled a slowdown in our application into the supervisor module. Turns out, it uses a dict for its children, which ends up generating lots of garbage (sort of n-squared) when adding/removing child processes a lot to a supervisor with lots of children. We're going to not use a supervisor for that case.</div>
<div><br></div><div>Which brings me back to a previous discussion: Most scripting languages have convenient hash table classes. Python has dict. JavaScript has Object. Erlang has dict, which isn't really O(1) for large sets, and gb_trees(), which is asymptotically O(log n), and ets, which is close to O(1) -- and is quite heavyweight.</div>
<div><br></div><div>I don't think it's possible to build an O(1) hash table on top of plain erlang data structures (as each time you modify an element, you have to re-create the top-level tuple). However, I imagine that with a C type, you could build one, that could keep item generation counts or similar to keep the amount of modified memory to a minimum. The question is: can it be done without the overhead of ETS? Has it been done?</div>
<div><br></div><div>Sincerely,</div><div><br></div><div>jw</div><div><br>--<br>Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable. <br>
<br>
<br><br><div class="gmail_quote">On Sat, Aug 6, 2011 at 9:55 AM, Robert Virding <span dir="ltr"><<a href="mailto:robert.virding@erlang-solutions.com">robert.virding@erlang-solutions.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Saw this on reddit. Any comments?<br>
<br>
<a href="http://code.mixpanel.com/2011/08/05/how-and-why-we-switched-from-erlang-to-python/" target="_blank">http://code.mixpanel.com/2011/08/05/how-and-why-we-switched-from-erlang-to-python/</a><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>
</blockquote></div><br></div>