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 #-} | |
module Network.ConnectionPool | |
( withConnection | |
, newConnectionPool | |
, closeConnectionPool | |
, ConnectionPool | |
) 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad.Trans | |
import qualified Data.ByteString.Lazy as L | |
import Snap.Http.Server | |
import Snap.Types | |
import Snap.Util.FileServe |
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 EmptyDataDecls #-} | |
{-# LANGUAGE PackageImports #-} | |
module Snaplets where | |
import "monads-fd" Control.Monad.State | |
import Data.ByteString (ByteString) | |
import Data.Dynamic | |
import Data.Map (Map) | |
import Snap.Types |
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
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 |
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
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 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 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 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 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 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 |
OlderNewer