[Haskell-cafe] performance question

Nicolas Bock nicolasbock at gmail.com
Fri Feb 8 21:56:24 CET 2013


Sorry, should have done this right away. Here are the other two scripts.


On Fri, Feb 8, 2013 at 1:45 PM, Bob Ippolito <bob at redivi.com> wrote:

> Do you mind posting createMatrixDump.py and printMatrixDecay.py? That
> would certainly make it easier to help you.
>
>
> On Fri, Feb 8, 2013 at 11:26 AM, Nicolas Bock <nicolasbock at gmail.com>wrote:
>
>> Hi list,
>>
>> I wrote a script that reads matrix elements from standard input, parses
>> the input using a regular expression, and then bins the matrix elements by
>> magnitude. I wrote the same script in python (just to be sure :) ) and find
>> that the python version vastly outperforms the Haskell script.
>>
>> To be concrete:
>>
>> $ time ./createMatrixDump.py -N 128 | ./printMatrixDecay
>> real    0m2.655s
>> user    0m2.677s
>> sys     0m0.095s
>>
>> $ time ./createMatrixDump.py -N 128 | ./printMatrixDecay.py -
>> real    0m0.445s
>> user    0m0.615s
>> sys     0m0.032s
>>
>> The Haskell script was compiled with "ghc --make printMatrixDecay.hs".
>>
>> Could you have a look at the script and give me some pointers as to where
>> I could improve it, both in terms of performance and also generally, as I
>> am very new to Haskell.
>>
>> Thanks already,
>>
>> nick
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130208/897bb136/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createMatrixDump.py
Type: application/octet-stream
Size: 461 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130208/897bb136/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printMatrixDecay.py
Type: application/octet-stream
Size: 1340 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130208/897bb136/attachment-0001.obj>


More information about the Haskell-Cafe mailing list