[Haskell-cafe] Battling time leaks

Joel Reymont joelr1 at gmail.com
Tue Dec 20 06:01:22 EST 2005


Folks,

It looks like I successfully squashed my time leaks and moving my  
serialization to Ptr Word8 got me as close to the metal as possible.  
I'm still getting wierd results, though, and they look like a time leak.

ORANGE ALERT: 0s, 6s, SrvServerInfo
ORANGE ALERT: 0s, 8s, SrvServerInfo
ORANGE ALERT: 0s, 9s, SrvServerInfo
ORANGE ALERT: 0s, 9s, SrvServerInfo
ORANGE ALERT: 0s, 7s, SrvServerInfo

unstuff :: Ptr Word8 -> Int -> IO Command
unstuff ptr ix =
     do TOD time1 _ <- getClockTime
        (kind, ix1) <- unpickle puCmdType ptr ix
        TOD time2 _ <- getClockTime
        (cmd', _) <- unpickle (puCommand kind) ptr ix1
        TOD time3 _ <- getClockTime
        when (time3 - time1 > 3) $
	-- fail here with the messages above

I would like to know where the time is going but how do I  
troubleshoot something like this?

My understanding is that regular profiling will give me the total  
time spent by cost-center so if I add cost-center annotations it will  
not give me the average time per run.

Come to think about it, the profiling report gives me the # of  
entries and the total time so I can get the average. Any other  
suggestions on how to figure out what is going on here?

	Thanks, Joel

--
http://wagerlabs.com/







More information about the Haskell-Cafe mailing list