Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: code critique (aditya siram)
----------------------------------------------------------------------
Message: 1
Date: Wed, 27 Jul 2011 00:34:36 -0500
From: aditya siram <[email protected]>
Subject: Re: [Haskell-beginners] code critique
To: Gary Klindt <[email protected]>
Cc: [email protected]
Message-ID:
<CAJrReyhHLv=RDR=upupxdu7vmrhggk8znehypxdvxgrxdls...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I just profiled all three and have not found them to be different.
Maybe I'm reading my profiler output wrong so I've pasted it below.
The compilation command I used was:
ghc -fforce-recomp -XBangPatterns -prof -rtsopts -auto-all -o
ListCrossProductSum ListCrossProductSum.hs
They were all invoked using:
main = print $ sumCheck 5000 [1..10000] [1..10000]
I am running GHC 7.0.1
-deech
sumcheck1:
==========
Wed Jul 27 00:26 2011 Time and Allocation Profiling Report (Final)
ListCrossProductSum +RTS -p -RTS
total time = 0.00 secs (0 ticks @ 20 ms)
total alloc = 344,084 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
sums Main 0.0 40.7
main Main 0.0 58.3
individual inherited
COST CENTRE MODULE
no. entries %time %alloc %time %alloc
MAIN MAIN
1 0 0.0 0.0 0.0 100.0
CAF Main
240 2 0.0 0.2 0.0 99.2
main Main
246 1 0.0 58.3 0.0 99.0
sumCheck Main
247 1 0.0 0.0 0.0 40.7
sums Main
248 1 0.0 40.7 0.0 40.7
CAF GHC.Show
236 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.FD
176 2 0.0 0.4 0.0 0.4
CAF System.Posix.Internals
175 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.Internals
140 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Encoding.Iconv
134 2 0.0 0.3 0.0 0.3
CAF GHC.Conc.Signal
131 1 0.0 0.1 0.0 0.1
sumcheck2
=========
[1 of 1] Compiling Main ( ListCrossProductSum.hs,
ListCrossProductSum.o )
True
Wed Jul 27 00:27 2011 Time and Allocation Profiling Report (Final)
ListCrossProductSum +RTS -p -RTS
total time = 0.00 secs (0 ticks @ 20 ms)
total alloc = 344,084 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
sums Main 0.0 40.7
main Main 0.0 58.3
individual inherited
COST CENTRE MODULE
no. entries %time %alloc %time %alloc
MAIN MAIN
1 0 0.0 0.0 0.0 100.0
CAF Main
240 2 0.0 0.2 0.0 99.2
main Main
246 1 0.0 58.3 0.0 99.0
sumCheck Main
247 1 0.0 0.0 0.0 40.7
sums Main
248 1 0.0 40.7 0.0 40.7
CAF GHC.Show
236 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.FD
176 2 0.0 0.4 0.0 0.4
CAF System.Posix.Internals
175 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.Internals
140 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Encoding.Iconv
134 2 0.0 0.3 0.0 0.3
CAF GHC.Conc.Signal
131 1 0.0 0.1 0.0 0.1
sumcheck3
=========
ListCrossProductSum +RTS -p -RTS
total time = 0.00 secs (0 ticks @ 20 ms)
total alloc = 344,084 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
sums Main 0.0 40.7
main Main 0.0 58.3
individual inherited
COST CENTRE MODULE
no. entries %time %alloc %time %alloc
MAIN MAIN
1 0 0.0 0.0 0.0 100.0
CAF Main
240 2 0.0 0.2 0.0 99.2
main Main
246 1 0.0 58.3 0.0 99.0
sumCheck Main
247 1 0.0 0.0 0.0 40.7
sums Main
248 1 0.0 40.7 0.0 40.7
CAF GHC.Show
236 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.FD
176 2 0.0 0.4 0.0 0.4
CAF System.Posix.Internals
175 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.Internals
140 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Encoding.Iconv
134 2 0.0 0.3 0.0 0.3
CAF GHC.Conc.Signal
131 1 0.0 0.1 0.0 0.1
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 37, Issue 61
*****************************************