summaryrefslogtreecommitdiff
path: root/docs/users_guide/profiling.xml
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/profiling.xml')
-rw-r--r--docs/users_guide/profiling.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/users_guide/profiling.xml b/docs/users_guide/profiling.xml
index 51ae6f71c3..f0d96ba98b 100644
--- a/docs/users_guide/profiling.xml
+++ b/docs/users_guide/profiling.xml
@@ -266,6 +266,22 @@ MAIN MAIN 0 0.0 0.0 100.0 100.0
far to the right as possible when parsing. (SCC stands for "Set
Cost Centre").</para>
+ <para>Here is an example of a program with a couple of SCCs:</para>
+
+<programlisting>
+main :: IO ()
+main = do let xs = {-# SCC "X" #-} [1..1000000]
+ let ys = {-# SCC "Y" #-} [1..2000000]
+ print $ last xs
+ print $ last $ init xs
+ print $ last ys
+ print $ last $ init ys
+</programlisting>
+
+ <para>which gives this heap profile when run:</para>
+
+ <imagedata fileref="prof_scc.png"/>
+
</sect2>
<sect2 id="prof-rules">