Re: [Haskell] Re: Probably a trivial thing for people knowing Haskell

2008-10-21 Thread Friedrich
Well I never have tried to profile here's my first try. I compiled with ghc --make -O -prof -auto-all chk_dwlds.hs I've run the program with: ./chk_dwlds \+RTS -p \-RTS and got this .prof file Tue Oct 21 15:01 2008 Time and Allocation Profiling Report (Final) chk_dwlds +RT

Re: [Haskell] Re: Probably a trivial thing for people knowing Haskell

2008-10-21 Thread Ketil Malde
Friedrich <[EMAIL PROTECTED]> writes: > Even the ruby solution need just > check_downloads/check_downloads.rb . 1,25s user 0,06s system 99% cpu > 1,322 total [...] > but the haskell solution: > ./chk_dwlds 17,71s user 0,11s system 99% cpu 17,836 total I'm very surprised to see this. Did y

Re: [Haskell] Re: Probably a trivial thing for people knowing Haskell

2008-10-21 Thread Friedrich
the posted codes runs in constant memory, so yes that make it possible that the stuff runs. That's really nice. Howerver the time is drastically bad Even the ruby solution need just check_downloads/check_downloads.rb . 1,25s user 0,06s system 99% cpu 1,322 total Here's the ruby code #!/usr/bin

[Haskell] Re: Probably a trivial thing for people knowing Haskell

2008-10-21 Thread apfelmus
Friedrich wrote: > Paul Johnson writes: >> >> -- Concatenate all the files into one big string. File reading is >> lazy, so this won't take all the memory. >> getAllFiles :: [String] -> IO String >> getAllFiles paths = do >> contents <- mapM getFile paths >> return $ concat contents >> >> Then