Re: [Haskell-cafe] my Fasta is slow ;(

2012-12-28 Thread Bryan O'Sullivan
I've already submitted it, thanks.

The Fortran program commits the same sin as the C++ one, of doing floating
point arithmetic in the inner loop; that's why it's slow.

On Dec 27, 2012, at 18:05, Branimir Maksimovic bm...@hotmail.com wrote:

 Thank you. Your entry is great. Faster than fortran entry!
Dou you want to contribute at the site, or you want me to do it for you?

--
Date: Thu, 27 Dec 2012 15:58:40 -0800
Subject: Re: [Haskell-cafe] my Fasta is slow ;(
From: b...@serpentine.com
To: bm...@hotmail.com
CC: haskell-cafe@haskell.org

On Tue, Dec 18, 2012 at 12:42 PM, Branimir Maksimovic bm...@hotmail.comwrote:


Seems to me that culprit  is in function random as I have tested rest of
code
and didn't found speed related  problems.


The problem with your original program was that it was not pure enough.
Because you stored your PRNG state in an IORef, you forced the program to
allocate and case-inspect boxed Ints in its inner loop.

I refactored it slightly to make genRand and genRandom pure, and combined
with using the LLVM back end, this doubled the program's performance, so
that the Haskell program ran at the same speed as your C++ version.

The next bottleneck was that your program was performing floating point
arithmetic in the inner loop. I changed it to precompute a small lookup
table, followed by only using integer arithmetic in the inner loop (the
same technique used by the fastest C fasta program). This further improved
performance: the new Haskell code is 40% faster than the C++ program, and
only ~20% slower than the C program that currently tops the shootout chart.
The Haskell source is a little over half the size of the C source.

You can follow the work I did here: https://github.com/bos/shootout-fasta
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Makefile for a Haskell Project

2012-12-28 Thread jims

Quoting xuan bach pig28...@gmail.com:


Hi everyone,
I'm a newbie in Haskell.

I'm wondering that if there is any tool support
creating Makefile for Haskell project like Ocamlbuild
for Ocaml project?


I'v just started learning how to use Neil Mitchell's Shake described at:

http://neilmitchell.blogspot.co.uk/2012/02/shake-better-make.html

Its available on hackage.

Hth

Thank you,
Regards.

--
*Le Dinh Xuan Bach*
*Tel: 01234711869 or +65 86967149
*
*Email: pig28...@gmail.com
School of Information and Communication,
*
*Hanoi University of Science and Technology
-
??
?01234711869 or +65 86967149
  pig28...@gmail.com
*






___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: shelltestrunner 1.3

2012-12-28 Thread Simon Michael


I'm pleased to announce the release of shelltestrunner 1.3. New in
this release:

* support latest Diff, cmdargs, test-framework; tested with GHC 7.6.1
(Magnus Therning)

* fix unicode handling on GHC = 7.2

shelltestrunner tests command-line programs (or arbitrary shell
commands.)
It reads simple declarative tests specifying a command, some input,
and
the expected output, and can run them run in parallel, selectively,
with a
timeout, in color, and/or with differences highlighted.
shelltestrunner
has been tested on gnu/linux, mac and windows; projects using it
include
hledger, berp, cblrepo and eddie. shelltestrunner is free software
released under GPLv3+.

Home: http://joyful.com/shelltestrunner

Install: $ cabal install shelltestrunner


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] getting upload date from hackage-db?

2012-12-28 Thread Patrick Pelletier
(Firstly, I apologize if this is not the right mailing list for this  
question.  But haskell-cafe seems to be the place to go when in doubt.)


I'm using the hackage-db package (Distribution.Hackage.DB) to analyze  
Hackage programatically.  It parses 00-index.tar and provides a  
mapping from package name and version to a GenericPackageDescription.


I've figured out how to get most of the information I want from the  
GenericPackageDescription.  But one piece of information that's  
present on the Hackage web pages that I'd like to be able to get is  
Upload date, but I can't find this information anywhere in the  
GenericPackageDescription.  Am I missing it?


It looks like the modification dates of the cabal files inside 00- 
index.tar correspond to the upload date.  Is this correct?  If so, I  
could parse this out of 00-index.tar myself (using the tar  
package).  Is that the best way to do what I'm trying to accomplish,  
or is there a better, less reinventing the wheel way that I'm missing?


Thanks,

--Patrick


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe