Skip to content

Instantly share code, notes, and snippets.

View snoyberg's full-sized avatar

Michael Snoyman snoyberg

View GitHub Profile
@snoyberg
snoyberg / run.sh
Last active January 18, 2017 12:57 — forked from UnkindPartition/run.sh
forM_ memory test
#!/usr/bin/env bash
set -eu
stack ghc -- -O2 test4.hs -rtsopts
for n in 5000 50000 500000 5000000; do
for impl in roman michael base; do
printf "%7d %10s" $n $impl
./test4 $impl $n +RTS -s 2>&1|perl -lne '/(^.*bytes).*residency/&&print $1'
compiler-check: match-exact
resolver: lts-7.10
compiler: ghc-8.0.1.20161117
setup-info:
ghc:
linux64:
8.0.1.20161117:
url: http://downloads.haskell.org/~ghc/8.0.2-rc1/ghc-8.0.1.20161117-x86_64-deb8-linux.tar.xz
content-length: 112047972
sha1: 6a6e4c9c53c71cc84b6966a9f61948542fd2f15a
@snoyberg
snoyberg / concur.hs
Last active December 20, 2015 12:58
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Data.Conduit.Concurrent where
import Control.Concurrent.Async
import Control.Concurrent.STM
import Control.Monad (forM_)
import Control.Monad.IO.Class
import Control.Monad.Trans.Control
import qualified Data.IORef as I
import qualified Control.Exception as E
import Control.Concurrent
import Control.Exception
import Control.Monad
import Network.Socket
main :: IO ()
main = do
pairCount <- I.newIORef 0