summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-09-26 20:38:32 +0000
committerIan Lynagh <igloo@earth.li>2008-09-26 20:38:32 +0000
commit0c12697ef809ab47dd10b6e292fe42140af72c3f (patch)
tree9b4da47298b17a79ed46311f04e9fb863140e0bd
parent6790af558efad6467b9ec0fc40f7a2e43d437fc7 (diff)
downloadhaskell-0c12697ef809ab47dd10b6e292fe42140af72c3f.tar.gz
Add an example of how to use SCCs to the user guide
-rw-r--r--docs/users_guide/Makefile4
-rw-r--r--docs/users_guide/prof_scc.pngbin0 -> 16815 bytes
-rw-r--r--docs/users_guide/profiling.xml16
3 files changed, 20 insertions, 0 deletions
diff --git a/docs/users_guide/Makefile b/docs/users_guide/Makefile
index 0657f4affc..86504b361c 100644
--- a/docs/users_guide/Makefile
+++ b/docs/users_guide/Makefile
@@ -7,3 +7,7 @@ INSTALL_XML_DOC = users_guide
include $(TOP)/mk/bindist.mk
include $(TOP)/mk/target.mk
+
+html::
+ cp prof_scc.png users_guide/
+
diff --git a/docs/users_guide/prof_scc.png b/docs/users_guide/prof_scc.png
new file mode 100644
index 0000000000..5e4157d657
--- /dev/null
+++ b/docs/users_guide/prof_scc.png
Binary files differ
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">