<br><br><div class="gmail_quote">On Wed, Feb 11, 2009 at 1:25 AM, Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I asked why (--) could not be implemented in Erlang instead of C.<div class="Ih2E3d"><br>
<br>
On 10 Feb 2009, at 9:44 pm, Hynek Vychodil wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It's easy, constants for serious amount |2|.<br>
</blockquote>
<br></div>
I am not sure how to interpret this.<br>
Let's face it, *as currently implemented* -- is not<br>
only inefficient, it can block scheduling for non-<br>
trivial amounts of time.  So as things stand now,<br>
fully informed programmers are unlikely to make very<br>
much use of it, so in any program where the constant<br>
factors are likely to make much difference, it is<br>
_already_ so slow that something else should be done.<br>
For example, I just measured some times:<br>
<br>
681.69 msec, bag difference of unsorted lists using --<br>
  0.64 msec, bag difference of sorted lists using own<br>
             sorted list difference code in Erlang<br>
 24.97 msec, bag difference of unsorted lists by<br>
             sorting then using sorted list difference.<br>
<br>
The one relying on a C coded -- is the slowest of them.<br>
<br>
OK, so the lists were 10,000 elements long.  Make them<br>
10 times smaller, and the times are<br>
  5.24 msec unsorted then --<br>
  0.08 msec presorted, use own Erlang<br>
  1.63 msec unsorted, use sort then own Erlang.<br>
Still the same conclusion: even coded in C, -- is too<br>
slow to use with any lists that might be nontrivial.<br>
So who cares about the constant factors in an operation<br>
that you shouldn't be using?  Every time we move something<br>
out of C into Erlang we simplify the trusted base.<br>
<br>
  <br>
</blockquote></div>Nice, and now measure this for 5 element long lists.<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>