
2008/9/8 Vlad Skvortsov
Posting to cafe since I got just one reply on beginner@. I was suggested to include more SCC annotations, but that didn't help. The 'serialize' function is still reported to consume about 32% of running time, 29% inherited. However, functions called from it only account for about 3% of time.
If "serialize" calls standard library functions, this is probably because the profiling libraries weren't built with -auto-all -- so the profiling report won't tell you how much time standard library functions consume. You can rebuild the libraries with -auto-all, but probably much easier would be to add SCC annotations to each call site. For example, you could annotate your locally defined dumpWith function like so: dumpWith f = {-# SCC "foldWithKey" #-} Data.Map.foldWithKey f [] docToStr k (Doc { docName=n, docVectorLength=vl}) = (:) ("d " ++ show k ++ " " ++ n ++ " " ++ (show vl)) Then your profiling report will tell you how much time/memory that particular call to foldWithKey uses. By the way, using foldl rather than foldl' or foldr is almost always a performance bug. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt Just enough: Obama/Biden '08.