Hi John,

You could try: [...]

It allocates less and has a smaller maximum residency: (ghc 6.12.2,windows 7 64)

    292,381,520 bytes allocated in the heap
     13,020,308 bytes maximum residency (8 sample(s))
99 MB total memory in use (9 MB lost due to fragmentation)

 MUT   time    5.85s  (  5.88s elapsed)

instead of:

   451,864,588 bytes allocated in the heap
      17,362,424 bytes maximum residency (8 sample(s))
99 MB total memory in use (9 MB lost due to fragmentation)

 MUT   time    9.11s  (  9.14s elapsed)

Interesting. It uses the same amount of memory but is faster probably because it allocates less.

But I prefer programs for people to read over programs for computers to execute and I have a hard time to verify that your algorithm computes Fibonacci numbers. I find it much easier to see from my implementation. Is your implementation the same algorithm? If yes, the transformations you made by hand should ideally be made by the compiler!

Cheers,
Sebastian

--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



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

Reply via email to