plutus-tx-plugin-1.72.0.0: The Plutus Tx compiler and GHC plugin
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Plugin.Timing

Description

Timing of Plinth compilation stages through GHC's own timing infrastructure.

Each stage is wrapped in withTiming, so it is reported alongside GHC's own phases under -ddump-timings (or -v2) and emits begin/end events to the eventlog.

Synopsis

Documentation

timeStage Source #

Arguments

∷ MonadIO monad 
⇒ Logger 
→ Bool

Whether to force the result with the given function.

→ String

Module or expression scope.

→ String

Stage name.

→ (result → ())

Forces the result; only called when timings are on and forcing is requested.

→ monad result

Action to measure.

→ monad result 

Time an action as the phase Plinth <stage> [<scope>].

When timings are off this is just the action. When they are on, the result is evaluated to WHNF and, if forcing is requested, further with the given function before the clocks stop.

timingsEnabled ∷ Logger → Bool Source #

Whether GHC will report timings: the same condition withTiming checks.