This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs, DataKinds, KindSignatures, TypeOperators | |
, ExistentialQuantification #-} | |
import GHC.TypeLits | |
import Data.Proxy | |
data Tree :: * -> Nat -> * where | |
Leaf :: a -> Tree a 0 | |
Node :: Tree a n -> Tree a n -> Tree a (n + 1) | |
instance Show a => Show (Tree a b) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2385620.743] | |
X.Org X Server 1.9.5 | |
Release Date: 2011-03-17 | |
[2385620.751] X Protocol Version 11, Revision 0 | |
[2385620.754] Build Operating System: Linux 2.6.38.4 x86_64 Gentoo | |
[2385620.757] Current Operating System: Linux macbeth 2.6.38.4 #2 SMP PREEMPT Sun May 1 19:08:44 CDT 2011 x86_64 | |
[2385620.759] Kernel command line: root=/dev/sda3 | |
[2385620.762] Build Date: 13 May 2011 12:46:23AM | |
[2385620.765] | |
[2385620.767] Current version of pixman: 0.20.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2399729.662] | |
X.Org X Server 1.9.5 | |
Release Date: 2011-03-17 | |
[2399729.665] X Protocol Version 11, Revision 0 | |
[2399729.666] Build Operating System: Linux 2.6.38.4 x86_64 Gentoo | |
[2399729.667] Current Operating System: Linux macbeth 2.6.38.4 #2 SMP PREEMPT Sun May 1 19:08:44 CDT 2011 x86_64 | |
[2399729.668] Kernel command line: root=/dev/sda3 | |
[2399729.669] Build Date: 13 May 2011 12:46:23AM | |
[2399729.670] | |
[2399729.671] Current version of pixman: 0.20.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
import qualified Data.ByteString as BS | |
import Data.ByteString (ByteString) | |
import Data.Word | |
import System.IO | |
--import Criterion.Main | |
runBS :: Word32 -> ByteString -> Word32 | |
runBS winlen bs = | |
snd $ {-# SCC "fold" #-} BS.foldl fn (0, 0) bs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sun Jun 5 11:28 2011 Time and Allocation Profiling Report (Final) | |
BSIter +RTS -p -RTS | |
total time = 18.84 secs (942 ticks @ 20 ms) | |
total alloc = 5,251,323,856 bytes (excludes profiling overheads) | |
COST CENTRE MODULE %time %alloc | |
fold Main 42.5 33.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
import qualified Data.ByteString as BS | |
import Data.ByteString (ByteString) | |
import Data.Word | |
import System.IO | |
--import Criterion.Main | |
runBS :: Word32 -> ByteString -> Word32 | |
runBS winlen bs = | |
snd $ {-# SCC "fold" #-} BS.foldl fn (0 :: Int, 0) bs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sun Jun 5 11:49 2011 Time and Allocation Profiling Report (Final) | |
BSIter +RTS -p -RTS | |
total time = 23.00 secs (1150 ticks @ 20 ms) | |
total alloc = 5,251,323,472 bytes (excludes profiling overheads) | |
COST CENTRE MODULE %time %alloc | |
fold Main 44.2 33.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warming up | |
estimating clock resolution... | |
mean is 15.79065 us (40001 iterations) | |
found 1344 outliers among 39999 samples (3.4%) | |
1235 (3.1%) high severe | |
estimating cost of a clock call... | |
mean is 2.088917 us (49 iterations) | |
found 2 outliers among 49 samples (4.1%) | |
1 (2.0%) high mild | |
1 (2.0%) high severe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Word | |
import Criterion.Main | |
fi :: Word8 -> Word32 | |
fi = fromIntegral | |
main = defaultMain [ bgroup "words" [ bench "noconvert" $ nf id (0 :: Word32) | |
, bench "convert" $ nf fi 0 ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10,429,347,888 bytes allocated in the heap | |
3,865,080 bytes copied during GC | |
16,798,864 bytes maximum residency (2 sample(s)) | |
1,063,280 bytes maximum slop | |
18 MB total memory in use (0 MB lost due to fragmentation) | |
Generation 0: 19859 collections, 0 parallel, 0.28s, 0.30s elapsed | |
Generation 1: 2 collections, 0 parallel, 0.00s, 0.00s elapsed | |
INIT time 0.00s ( 0.00s elapsed) |
OlderNewer