
3 Jun
2009
3 Jun
'09
3:04 p.m.
Nico Rolle wrote:
is there a quick way to check which function is doing the job quicker? i have 2 functions which i want to compare. both give the same output but they do it in different manner. i want to test which one is faster. i use ghci.
For simple testing in the interactive environment, use :set +s and after each evaluation the memory usage and the number of elapsed seconds will be displayed. If you want more, look up the profiling support in the documentation of GHC http://www.haskell.org/ghc/docs/latest/html/users_guide/profiling.html GHC provides both memory and time profiling. Regards, -- Jochem Berndsen | jochem@functor.nl GPG: 0xE6FABFAB