2009-05-24, 03:12 PM
Sounds like me on a bad day.
Spoiler
Quote:(kl. 05.47 +0200) roconnor: gnuvince_: heh, my Writer.Strict code takes 1 minute for depth 20000.
(kl. 05.47 +0200) roconnor: that's about 2^20000 nodes, which is a number so big that it would fill the entire size of the python chart.
(kl. 05.48 +0200) roconnor: > 2^20001
(kl. 05.48 +0200) lambdabot: 796055368067593318470861441238240490740954556098485187742685373130477271949...
(kl. 05.48 +0200) copumpkin: > length . show $ 2 ^ 20001
(kl. 05.48 +0200) lambdabot: 6021
(kl. 05.48 +0200) roconnor: > (length . show $ 2 ^ 20001) `div` 80
(kl. 05.48 +0200) lambdabot: 75
(kl. 05.49 +0200) Berengal: roconnor: Was this using the weird python definition of a binary tree?
(kl. 05.49 +0200) roconnor: http://hpaste.org/fastcgi/hpaste.fcgi/vi...5139#a5156
(kl. 05.49 +0200) ***dmwit is so lost right now
(kl. 05.49 +0200) roconnor: that is my current version I'm using.
(kl. 05.51 +0200) copumpkin: dmwit: ?
(kl. 05.51 +0200) roconnor: dmwit: gnuvince_ wanted a Haskell version of this python code: http://www.smallshire.org.uk/sufficientl...ython-2-5/
(kl. 05.52 +0200) dmwit: roconnor: Thanks, that was the context I was hoping for. =)
(kl. 05.52 +0200) Berengal: roconnor: Unless there's something I'm not getting, you're saying your machine counted that high in a minute?
(kl. 05.52 +0200) roconnor: even though that code uses a global variable.
(kl. 05.52 +0200) roconnor: Berengal: hmm
(kl. 05.53 +0200) roconnor: It does seem like that, and also that seems impossible.
(kl. 05.53 +0200) roconnor: I wonder if there is too much sharing going on.
(kl. 05.53 +0200) Berengal: Yes, it seems very impossible
(kl. 05.53 +0200) Berengal: At least in this day and age
(kl. 05.53 +0200) Berengal: There has to be something else going on here
(kl. 05.53 +0200) roconnor: damn, I might have accidentally made my program run in logarithmic time
(kl. 05.54 +0200) Berengal: Hehehe
(kl. 05.55 +0200) roconnor: okay, I removed the replicateM
(kl. 05.55 +0200) roconnor: and used
(kl. 05.55 +0200) roconnor: make depth = do
(kl. 05.55 +0200) roconnor: t1 <-(make (depth -1))
(kl. 05.55 +0200) roconnor: t2 <-(make (depth -1))
(kl. 05.55 +0200) roconnor: node [t1,t2]
(kl. 05.55 +0200) roconnor: But now it runs twice as fast ...
(kl. 05.55 +0200) roconnor: :^)
(kl. 05.55 +0200) roconnor: damn it
(kl. 05.56 +0200) roconnor: I don't know how to make this as slow as python.
(kl. 05.56 +0200) copumpkin: roconnor has discovered sub-constant time
(kl. 05.56 +0200) copumpkin: everything he adds to his code makes it faster!

