Skip to content

Commit

Permalink
Make it easier to compare the old and the new I/O manager in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbe committed Jan 23, 2010
1 parent 1a26527 commit c399be7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions benchmarks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ include ../tests/common.mk

ghc-bench-flags := -package network -package network-bytestring

ifdef USE_GHC_IO_MANAGER
ghc-bench-flags += -DUSE_GHC_IO_MANAGER
endif

.PHONY: all
all: pong simple thread-delay timers

Expand All @@ -16,6 +20,7 @@ simple: $(lib) Args.o Simple.o
ranlib $(lib)
$(ghc) $(ghc-flags) -threaded -o $@ $(filter %.o,$^) $(lib)

thread-delay: ghc-flags += $(ghc-bench-flags)
thread-delay: $(lib) Args.o ThreadDelay.o
ranlib $(lib)
$(ghc) $(ghc-flags) -threaded -o $@ $(filter %.o,$^) $(lib)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/ThreadDelay.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import System.Console.GetOpt (ArgDescr(ReqArg), OptDescr(..))
import System.Environment (getArgs)
import System.Event.Thread (ensureIOManagerIsRunning)

#if 1
import System.Event.Thread (threadDelay)
#else
#ifdef USE_GHC_IO_MANAGER
import Control.Concurrent (threadDelay)
#else
import System.Event.Thread (threadDelay)
#endif

main = do
Expand Down

0 comments on commit c399be7

Please sign in to comment.