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
-- | Internal implementation of the @io-streams@ library, intended for library | |
-- writers | |
-- | |
-- Library users should use the interface provided by "System.IO.Streams" | |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE OverloadedStrings #-} |
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
streams /usr/local/google/home/gdc/tmp/haskell/conduit/io-streams-conduit [*] $ ./bench -g -o report.html | |
warming up | |
estimating clock resolution... | |
mean is 1.412510 us (640001 iterations) | |
found 3120 outliers among 639999 samples (0.5%) | |
2526 (0.4%) high severe | |
estimating cost of a clock call... | |
mean is 32.34526 ns (14 iterations) | |
found 3 outliers among 14 samples (21.4%) | |
3 (21.4%) low severe |
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 GeneralizedNewtypeDeriving #-} | |
import Data.Hashable | |
import qualified Data.HashTable.IO as H | |
newtype HInt = HInt Int | |
deriving (Num, Eq, Ord) | |
instance Hashable HInt where | |
hashWithSalt _ (HInt k) = k |
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
master /Users/gdc/personal/src/hashtables/benchmark [*] $ ./dist/build/hashtable-benchmark/hashtable-benchmark +RTS -A4M | |
Results for Lookup Performance | |
------------------------------------------------------------------------------ | |
Data structure Data.Map | |
Input Sz Mean (secs) Stddev (secs) 95% (secs) Max (secs) | |
-------------- -------------- -------------- -------------- -------------- | |
256000 2.465126 us 17.26822 ns 2.479528 us 2.480998 us | |
512000 3.009511 us 45.81664 ns 3.066010 us 3.084894 us |
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
Results for Insert consecutive ints (mixed) | |
------------------------------------------------------------------------------ | |
Data structure Data.Map | |
Input Sz Mean (secs) Stddev (secs) 95% (secs) Max (secs) | |
-------------- -------------- -------------- -------------- -------------- | |
256000 837.1738 ns 65.40328 ns 915.0820 ns 932.6642 ns | |
512000 752.8473 ns 57.77999 ns 801.8761 ns 810.1773 ns |
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
/Users/greg/personal/src/snap/http-streams/src/Network/Http/.stylish-haskell.yaml does not exist | |
/Users/greg/.stylish-haskell.yaml exists | |
/Users/greg/.cabal/share/stylish-haskell-0.5.4.0/data/stylish-haskell.yaml exists | |
Loading configuration at /Users/greg/.stylish-haskell.yaml |
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 OverloadedStrings #-} | |
import Blaze.ByteString.Builder (Builder, | |
fromByteString) | |
import Blaze.ByteString.Builder.Char8 (fromChar, fromShow) | |
import Blaze.ByteString.Builder.Internal.Buffer (allocBuffer) | |
import Control.Applicative (pure, (<$>), (<*), | |
(<|>)) | |
import Control.Monad (void) |
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
#include <errno.h> | |
#include <fcntl.h> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <netinet/tcp.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <strings.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> |
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 OverloadedStrings, MagicHash, UnboxedTuples, BangPatterns #-} | |
import Control.Monad (replicateM_) | |
import Criterion.Main (defaultMain, bench, whnfIO) | |
import qualified Data.ByteString as S | |
import qualified Data.ByteString.Char8 as S8 | |
import Data.ByteString.Unsafe (unsafePackAddressLen, unsafeUseAsCStringLen) | |
import qualified Data.Char | |
import Data.Char (ord) | |
import qualified Data.Word8 |
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 ForeignFunctionInterface #-} | |
module Bench where | |
import Control.Monad | |
import Criterion.Main | |
import Foreign | |
import Foreign.C.Types |