'--' have O(N.M) complexity, if you suspect big M use you own O(M+N.logM) implementation. Do not use '--' for big M.<br><br><div class="gmail_quote">2009/1/13 Malcolm Dowse <span dir="ltr"><<a href="mailto:malcolm@demonware.net">malcolm@demonware.net</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I ran into an issue with Erlang the other day. I'm not sure if it's a bug, but I thought I should warn others.<br>
<br>I was using '--' to get the difference between two large lists. As expected it was very slow, but, to my surprise, ERTS became completely unresponsive for a long time.
(Only one CPU was maxed out, and there was still plenty of memory
available.)<br>
<br>To reproduce (on Ubuntu 7.x, R12B-x), open an Erlang shell and type:<br><br>spawn(fun() -> lists:seq(1,1000000) -- lists:seq(1,1000000,2) end).<br><br>The unresponsiveness seems to be caused by '--' being a BIF. Is there a good reason for making it a BIF if it's not always an improvement?<br>
<br>All the best,<br><font color="#888888"><br>Malcolm<br><br>
</font><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br><br clear="all"><br>-- <br>--Hynek (Pichi) Vychodil<br>
<br>Analyze your data in minutes. Share your insights instantly. Thrill your boss. Be a data hero!<br>Try Good Data now for free: <a href="http://www.gooddata.com">www.gooddata.com</a><br>