perf-0.1.1: low-level performance statistics

Safe HaskellNone
LanguageHaskell2010

Perf.Cycles

Contents

Synopsis

Documentation

type Cycles = Word64 Source #

Cycles

tick :: (a -> b) -> a -> IO (Cycles, b) Source #

`tick f a` applies a to f, and strictly returns a (number of cycles, application result) tuple

tick' :: a -> IO (Cycles, a) Source #

variation that just acts on an a

tickM :: IO a -> IO (Cycles, a) Source #

variation that takes an `IO a`

tick_ :: IO Cycles Source #

variation that just measures the number of cycles to take a tick measurement

tickf :: (a -> b) -> a -> IO (Cycles, b) Source #

`tickf f a` applies a to f, and strictly returns a (number of cycles, application result) tuple, measuring just the f effect

tickfM :: (a -> IO b) -> a -> IO (Cycles, b) Source #

monadic version

ticka :: (a -> b) -> a -> IO (Cycles, b) Source #

`ticka f a` applies a to f, and strictly returns a (number of cycles, application result) tuple, measuring just the a effect

tickfa :: (a -> b) -> a -> IO ((Cycles, Cycles), b) Source #

`tickfa f a` applies a to f, and strictly returns a (number of cycles, application result) tuple, measuring both the f and the a effects separately.

spin :: Int -> ((a -> b) -> a -> IO (c, b)) -> (a -> b) -> a -> IO ([c], b) Source #

n measurements of whatever tick engine

spins :: Int -> ((a -> b) -> a -> IO (c, b)) -> (a -> b) -> [a] -> IO ([[c]], [b]) Source #

spinM :: Int -> ((a -> IO b) -> a -> IO (c, b)) -> (a -> IO b) -> a -> IO ([c], b) Source #

n measurements of whatever tick engine

warmup :: Int -> IO Double Source #

warm up the register, and the setup

force :: NFData a => a -> a Source #

helpers

replicateM' :: Monad m => Int -> m a -> m [a] Source #

Orphan instances