Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions to support the constant space traversal of a heap. This module is like the Trace module but performs the tracing in parellel. The speed-up is quite modest but hopefully can be improved in future.
The tracing functions create a thread for each MBlock which we traverse, closures are then sent to the relevant threads to be dereferenced and thread-local storage is accumulated.
Synopsis
- traceParFromM :: Monoid s => TraceFunctionsIO a s -> [ClosurePtrWithInfo a] -> DebugM s
- tracePar :: [ClosurePtr] -> DebugM ()
- data TraceFunctionsIO a s = TraceFunctionsIO {
- papTrace :: !(GenPapPayload ClosurePtr -> DebugM ())
- srtTrace :: !(GenSrtPayload ClosurePtr -> DebugM ())
- stackTrace :: !(GenStackFrames SrtCont ClosurePtr -> DebugM ())
- closTrace :: !(ClosurePtr -> SizedClosure -> a -> DebugM (a, s, DebugM () -> DebugM ()))
- visitedVal :: !(ClosurePtr -> a -> DebugM s)
- conDescTrace :: !(ConstrDesc -> DebugM ())
- data ClosurePtrWithInfo a = ClosurePtrWithInfo !a !ClosurePtr
Documentation
traceParFromM :: Monoid s => TraceFunctionsIO a s -> [ClosurePtrWithInfo a] -> DebugM s Source #
A generic heap traversal function which will use a small amount of memory linear in the heap size. Using this function with appropiate accumulation functions you should be able to traverse quite big heaps in not a huge amount of memory.
The performance of this parralel version depends on how much contention
the functions given in TraceFunctionsIO
content for the handle
connecting for the debuggee (which is protected by an MVar
). With no
contention, and precached blocks, the workload can be very evenly
distributed leading to high core utilisation.
As performance depends highly on contention, snapshot mode is much more amenable to parrelisation where the time taken for requests is much lower.
tracePar :: [ClosurePtr] -> DebugM () Source #
A parellel tracing function.
data TraceFunctionsIO a s Source #
TraceFunctionsIO | |
|
data ClosurePtrWithInfo a Source #
A ClosurePtr
with some additional information which needs to be
communicated across to another thread.