File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ import General.Pool
77import Control.Concurrent.Extra
88import Control.Exception.Extra
99import Control.Monad
10+ import System.Time.Extra
1011import Data.Either.Extra
12+ import General.Timing
1113
1214
1315main = testSimple $ do
@@ -92,3 +94,12 @@ main = testSimple $ do
9294 add pool $ try_ $ (do signalBarrier started () ; sleep 10 ) `finally` (do sleep 1 ; writeVar var True )
9395 add pool $ do waitBarrier started; throw Overflow
9496 (=== True ) =<< readVar var
97+
98+ -- benchmark for testing thread performance, see https://github.com/ndmitchell/shake/pull/751
99+ when False $ do
100+ resetTimings
101+ withNumCapabilities 4 $ do
102+ (d, _) <- duration $ runPool False 4 $ \ pool -> do
103+ replicateM_ 200000 $ addPool PoolStart pool $ return ()
104+ print d
105+ print =<< getTimings
You can’t perform that action at this time.
0 commit comments