--- Arie Groeneveld <[EMAIL PROTECTED]> wrote:
> Roger Hui wrote:
> >> Can't help it, but here's an illustration in speed difference
> >> between Haskell GHCi (interpreted) and J on this subject.
> >
> > How does Haskell GHCi perform on things like summation,
> > maximum, sort, and indexing? e.g. For each of the following
> > arguments,
> >
> > i4=: 1e6 [EMAIL PROTECTED] 2e4
> > i9=: 1e6 [EMAIL PROTECTED] 2e9
> > d =: 1e6 [EMAIL PROTECTED] 0
> >
> > ts '+/ i4'
> > ts '>./ i4'
> > ts '/:~ i4'
> > ts 'i.~ i4'
> > ts '+/i6'
> > etc.
> First of all it's not my intention to promote Haskell by you
> J-ers! I'm as much interested in Haskell as in J. The speed
> difference is just an aspect in this matter that caught my attention!
>
> But you asked for it, so here are some comparison's
> in advantage to J to reassure you (if necessary) :
>
> *Main> sum [1..1000000]
> 500000500000
> (3.04 secs, 165391456 bytes)
>
> Here's what they call in Haskell a strict version of summing:
> *Main> foldl' (+) 0 [1..1000000]
> 500000500000
> (0.36 secs, 112405920 bytes)
> Still a lot slower!
>
> Other actions are alike: much slower in interpreted Haskell.
> Hoping I didn't offend you too much caused by my naive way
> of putting things ;-)
> And no, you don't have to convince of the beauty and power of J.
> And finally if you people don't want this kind of fuzz
> on your forum please don't hesitate tell me!
The point is that the proposed comparison (to length . powerset)
is unfair because they can use lazy evaluation--but it's when you
access the data that counts, otherwise it's just:
x:2^20
1048576
ts'x:2^20'
8.38571e_6 1344
or
2^20x
1048576
ts'2^20x'
5.99837e_6 1728
____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today!
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm