Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-22 Thread Bas van Dijk
On 20 October 2011 22:16, thomas burt thedwa...@gmail.com wrote: Perhaps I will try and force `stuffToDo` not to leave any partially evaluated thunks behind and compare the cost then. What happens when you switch to a strict StateT? Bas ___

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-22 Thread thomas burt
Sorry, thought I had replied to this with my result! I added `seq` and $! inside `stuffToDo` to ensure that there weren't any thunks left around after it was called. The measured times were only a few hundredths of a second apart after that. So, apparently even with a strict StateT, partially

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-22 Thread Daniel Fischer
On Saturday 22 October 2011, 23:07:44, thomas burt wrote: Sorry, thought I had replied to this with my result! I added `seq` and $! inside `stuffToDo` to ensure that there weren't any thunks left around after it was called. The measured times were only a few hundredths of a second apart

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-21 Thread Albert Y. C. Lai
On 11-10-20 01:38 PM, thomas burt wrote: I've been trying to measure execution time for some code I'm running with the StateT monad transformer. I have a function f :: StateT MyState IO a Now, I measure the time it takes to run an invocation of this function from beginning to end, i.e. f = do

[Haskell-cafe] runStateT execution times measurement baffling

2011-10-20 Thread thomas burt
Hello - I've been trying to measure execution time for some code I'm running with the StateT monad transformer. I have a function f :: StateT MyState IO a Now, I measure the time it takes to run an invocation of this function from beginning to end, i.e. f = do t0 - getCurrentTime stuffToDo

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-20 Thread David Barbour
On Thu, Oct 20, 2011 at 10:38 AM, thomas burt thedwa...@gmail.com wrote: Curiously, the times reported for outside are about 5-8 times as long. What is the cost of putStrLn relative to performing `stuffToDo` a few hundred times? ___ Haskell-Cafe

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-20 Thread thomas burt
On Thu, Oct 20, 2011 at 11:59 AM, David Barbour dmbarb...@gmail.com wrote: On Thu, Oct 20, 2011 at 10:38 AM, thomas burt thedwa...@gmail.com wrote: Curiously, the times reported for outside are about 5-8 times as long. What is the cost of putStrLn relative to performing `stuffToDo` a few