From 89f034ddeb4ad7d93c877d5bdbcf2cca7a44f79c Mon Sep 17 00:00:00 2001 From: Maximilian Tagher Date: Sat, 1 Feb 2020 14:27:10 -0800 Subject: Document the units of -ddump-timings Right now, in the output of -ddump-timings to a file, you can't tell what the units are: ``` CodeGen [TemplateTestImports]: alloc=22454880 time=14.597 ``` I believe bytes/milliseconds are the correct units, but confirmation would be appreciated. I'm basing it off of this snippet from `withTiming'`: ``` when (verbosity dflags >= 2 && prtimings == PrintTimings) $ liftIO $ logInfo dflags (defaultUserStyle dflags) (text "!!!" <+> what <> colon <+> text "finished in" <+> doublePrec 2 time <+> text "milliseconds" <> comma <+> text "allocated" <+> doublePrec 3 (realToFrac alloc / 1024 / 1024) <+> text "megabytes") ``` which implies time is in milliseconds, and allocations in bytes (which divided by 1024 would be KB, and again would be MB) --- docs/users_guide/debugging.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/users_guide/debugging.rst') diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index 82d10e6e99..61a06b2e38 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -87,6 +87,7 @@ Dumping out compiler intermediate structures :type: dynamic Show allocation and runtime statistics for various stages of compilation. + Allocations are measured in bytes. Timings are measured in milliseconds. GHC is a large program consisting of a number of stages. You can tell GHC to dump information from various stages of compilation using the ``-ddump-⟨pass⟩`` -- cgit v1.2.1