[Haskell-cafe] Re: Importing Data.Char speeds up ghc around 70%
Daniel Fischer
daniel.is.fischer at web.de
Sat Dec 22 15:45:42 EST 2007
Am Samstag, 22. Dezember 2007 20:48 schrieb Joost Behrends:
> Daniel Fischer <daniel.is.fischer <at> web.de> writes:
> > I can't reproduce it, both run in 130s here (SuSE 8.2, 1200MHz Duron).
> > However, it's running over 30 minutes now trying to factorise 2^88+1
> > without any sign of approaching success, which suggests your code has a
> > bug (the factorization is [257,229153,119782433,43872038849], so even a
> > naive approach shouldn't take much longer than a minute).
>
> Yes, Daniel
>
> the code is not completely correct. There is a known bug. Don't know the
> connection to your number, but it doesn't decompose 29*29*31*31 correctly
> (gives [29,29,961] neither 59*59*61*61 (gives [59*59*3721]).
>
Perhaps
Prelude Main> primefactors $ 7*17*29
[7,493]
Prelude Main> primefactors $ 7*23*29
[7,667]
Prelude Main> primefactors $ 7*11*23
[7,253]
help you find the bug? If not, ask and ye shall be answered.
> Difficult to find it, but that has nothing to do with the strange
> differences of speed.
True, and I have no idea how that could come.
>
> Cheers, Joost
>
Cheers,
Daniel
More information about the Haskell-Cafe
mailing list