This file contains hidden or 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 CPP, BangPatterns #-} | |
module Main where | |
import Control.DeepSeq | |
import Data.List | |
ensure :: [Int] -> IO [Int] | |
ensure xs = xs `deepseq` return xs |
This file contains hidden or 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 CPP #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-| | |
This module exports the 'Config' datatype, which you can use to configure the | |
Snap HTTP server. | |
-} |
This file contains hidden or 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 #-} | |
{-# LANGUAGE MagicHash #-} | |
{-# LANGUAGE ForeignFunctionInterface #-} | |
module Main where | |
import Criterion | |
import Criterion.Main | |
import Data.Bits | |
import Foreign.C |
This file contains hidden or 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 ScopedTypeVariables #-} | |
import Control.Concurrent (killThread) | |
import Control.Concurrent.BoundedChan | |
import Control.Concurrent.Thread | |
import Control.Exception (SomeException) | |
import Control.Monad.CatchIO | |
import Control.Monad.Trans | |
import Prelude hiding (catch) | |
import qualified Data.Enumerator.List as E |
This file contains hidden or 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 #-} | |
----------------------------------------------------------------------------- | |
-- | | |
-- Copyright: 2010 John Millikin | |
-- License: MIT | |
-- | |
-- Maintainer: [email protected] | |
-- Portability: portable | |
-- |
This file contains hidden or 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
instance Monad m => Monad (Iteratee a m) where | |
return x = yield x (Chunks []) | |
m >>= f = bind m f | |
{-# INLINE bind #-} | |
bind :: Monad m => | |
Iteratee a m b | |
-> (b -> Iteratee a m c) | |
-> Iteratee a m c |
This file contains hidden or 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
ByteString keys between 8-32 characters long (ascii, hex digits). Test run on a Macbook Pro (2.53GHz Intel Core i5) running GHC 6.12.3. | |
$ ./dist/build/ucoll-benchmark/ucoll-benchmark +RTS -N -A4M | |
Results for Insert Performance | |
------------------------------------------------------------------------------ | |
Data structure Data.Map | |
Input Sz Mean (secs) Stddev (secs) 95% (secs) Max (secs) |
This file contains hidden or 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 11.41351 us (80001 iterations) | |
found 7313 outliers among 79999 samples (9.1%) | |
1159 (1.4%) high mild | |
6137 (7.7%) high severe | |
estimating cost of a clock call... | |
mean is 166.3485 ns (77 iterations) | |
found 8 outliers among 77 samples (10.4%) | |
3 (3.9%) high mild |
This file contains hidden or 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
catchError' :: Monad m => | |
Iteratee a m b | |
-> (SomeException -> Iteratee a m b) | |
-> Iteratee a m b | |
catchError' iter h = do | |
step <- lift $ runIteratee iter | |
go step | |
where | |
go step = |
This file contains hidden or 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
Tue Aug 24 18:04 2010 Time and Allocation Profiling Report (Final) | |
pongserver +RTS -p -A4M -qg0 -qb -g1 -RTS | |
total time = 24.18 secs (1209 ticks @ 20 ms) | |
total alloc = 13,228,877,164 bytes (excludes profiling overheads) | |
COST CENTRE MODULE %time %alloc | |
sendData Snap.Internal.Http.Server.LibevBackend 15.2 0.0 |