Module Profile

Preliminary library to support profiling.

Author: Michael Hanus

Version: December 2007

Summary of exported operations:

getProcessInfos :: IO [(ProcessInfo,Int)]   
Returns various informations about the current state of the Curry process.
garbageCollectorOff :: IO ()   
Turns off the garbage collector of the run-time system (if possible).
garbageCollectorOn :: IO ()   
Turns on the garbage collector of the run-time system (if possible).
garbageCollect :: IO ()   
Invoke the garbage collector (if possible).
showMemInfo :: [(ProcessInfo,Int)] -> String   
Get a human readable version of the memory situation from the process infos.
printMemInfo :: IO ()   
Print a human readable version of the current memory situation of the Curry process.
profileTime :: IO a -> IO a   
Print the time needed to execute a given IO action.
profileTimeNF :: a -> IO ()   
Evaluates the argument to normal form and print the time needed for this evaluation.
profileSpace :: IO a -> IO a   
Print the time and space needed to execute a given IO action.
profileSpaceNF :: a -> IO ()   
Evaluates the argument to normal form and print the time and space needed for this evaluation.
evalTime :: a -> a   
Evaluates the argument to normal form (and return the normal form) and print the time needed for this evaluation on standard error.
evalSpace :: a -> a   
Evaluates the argument to normal form (and return the normal form) and print the time and space needed for this evaluation on standard error.

Exported datatypes:


ProcessInfo

The data type for representing information about the state of a Curry process.

Constructors:

  • RunTime :: ProcessInfo : the run time in milliseconds
  • ElapsedTime :: ProcessInfo : the elapsed time in milliseconds
  • Memory :: ProcessInfo : the total memory in bytes
  • Code :: ProcessInfo : the size of the code area in bytes
  • Stack :: ProcessInfo : the size of the local stack for recursive functions in bytes
  • Heap :: ProcessInfo : the size of the heap to store term structures in bytes
  • Choices :: ProcessInfo : the size of the choicepoint stack
  • GarbageCollections :: ProcessInfo : the number of garbage collections performed

Exported operations:

getProcessInfos :: IO [(ProcessInfo,Int)]   

Returns various informations about the current state of the Curry process. Note that the returned values are very implementation dependent so that one should interpret them with care!

Further infos:
  • externally defined

garbageCollectorOff :: IO ()   

Turns off the garbage collector of the run-time system (if possible). This could be useful to get more precise data of memory usage.

Further infos:
  • externally defined

garbageCollectorOn :: IO ()   

Turns on the garbage collector of the run-time system (if possible).

Further infos:
  • externally defined

garbageCollect :: IO ()   

Invoke the garbage collector (if possible). This could be useful before run-time critical operations.

Further infos:
  • externally defined

showMemInfo :: [(ProcessInfo,Int)] -> String   

Get a human readable version of the memory situation from the process infos.

printMemInfo :: IO ()   

Print a human readable version of the current memory situation of the Curry process.

profileTime :: IO a -> IO a   

Print the time needed to execute a given IO action.

profileTimeNF :: a -> IO ()   

Evaluates the argument to normal form and print the time needed for this evaluation.

profileSpace :: IO a -> IO a   

Print the time and space needed to execute a given IO action. During the executation, the garbage collector is turned off to get the total space usage.

profileSpaceNF :: a -> IO ()   

Evaluates the argument to normal form and print the time and space needed for this evaluation. During the evaluation, the garbage collector is turned off to get the total space usage.

evalTime :: a -> a   

Evaluates the argument to normal form (and return the normal form) and print the time needed for this evaluation on standard error. Included for backward compatibility only, use profileTime!

Further infos:
  • externally defined

evalSpace :: a -> a   

Evaluates the argument to normal form (and return the normal form) and print the time and space needed for this evaluation on standard error. During the evaluation, the garbage collector is turned off. Included for backward compatibility only, use profileSpace!

Further infos:
  • externally defined