on master help sign in
Use smaller input files for longer benchmarks
commit53504dba3c8088465fefd1d170828c955c6d4083 authorHarendra Kumar <harendra@composewell.com> dateTue 7 Jul 2020, 19:58 (6 years ago) parent3d033ae
1 file changed+280−294
benchmark/Streamly/Benchmark/FileSystem/Handle.hs+280−294
benchmark/Streamly/Benchmark/FileSystem/Handle.hs+280−294
@@ -19,12 +19,14 @@
1919{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
2020#endif
2121
22−import Control.DeepSeq (NFData)
22+import Control.DeepSeq (NFData(rnf))
2323import Control.Exception (SomeException)
2424import Data.Char (ord, chr)
2525import Data.Functor.Identity (runIdentity)
2626import Data.Word (Word8)
27+#if __GLASGOW_HASKELL__ >= 800
2728import System.Directory (getFileSize)
29+#endif
2830import System.Environment (lookupEnv)
2931import System.IO (openFile, IOMode(..), Handle, hClose)
3032import System.Process.Typed (shell, runProcess_)
@@ -92,25 +94,81 @@ blockSize = 32768
9294blockCount :: Int -> Int
9395blockCount size = (size + blockSize - 1) `div` blockSize
9496
95−data Handles = Handles Handle Handle
96−
97−mkBench :: NFData b => String -> IORef Handles -> IO b -> Benchmark
98−mkBench name href action =
97+data RefHandles = RefHandles
98+ { smallInH :: Handle
99+ , bigInH :: Handle
100+ , outputH :: Handle
101+ }
102+
103+data Handles = Handles !Handle !Handle
104+
105+instance NFData Handles where
106+ rnf _ = ()
107+
108+data BenchEnv = BenchEnv
109+ { href :: IORef RefHandles
110+ , smallSize :: Int
111+ , bigSize :: Int
112+ , nullH :: Handle
113+ }
114+
115+withScaling :: BenchEnv -> String -> String
116+withScaling env str =
117+ let factor = round (fromIntegral (bigSize env)
118+ / (fromIntegral (smallSize env) :: Double)) :: Int
119+ in if factor == 1
120+ then str
121+ else str ++ " (1/" ++ show factor ++ ")"
122+
123+mkBenchCommon ::
124+ NFData b
125+ => (RefHandles -> Handles)
126+ -> String
127+ -> BenchEnv
128+ -> (Handle -> Handle -> IO b)
129+ -> Benchmark
130+mkBenchCommon mkHandles name env action =
99131 bench name $ perRunEnv (do
100− Handles inH outH <- readIORef href
132+ r <- readIORef $ href env
101133
102134 -- close old handles
103− hClose inH
104− hClose outH
135+ hClose $ smallInH r
136+ hClose $ bigInH r
137+ hClose $ outputH r
105138
106139 -- reopen
107− inh <- openFile inFileBig ReadMode
108− outh <- openFile outfile WriteMode
140+ smallInHandle <- openFile inFileSmall ReadMode
141+ bigInHandle <- openFile inFileBig ReadMode
142+ outHandle <- openFile outfile WriteMode
143+
144+ let refHandles = RefHandles
145+ { smallInH = smallInHandle
146+ , bigInH = bigInHandle
147+ , outputH = outHandle
148+ }
109149
110150 -- update
111− writeIORef href $ Handles inh outh
151+ writeIORef (href env) $ refHandles
152+ return $ mkHandles refHandles
112153 )
113− (\_ -> action)
154+ (\(Handles h1 h2) -> action h1 h2)
155+
156+mkBench ::
157+ NFData b => String -> BenchEnv -> (Handle -> Handle -> IO b) -> Benchmark
158+mkBench name env action = mkBenchCommon useBigH name env action
159+
160+ where
161+
162+ useBigH (RefHandles {bigInH = inh, outputH = outh}) = Handles inh outh
163+
164+mkBenchSmall ::
165+ NFData b => String -> BenchEnv -> (Handle -> Handle -> IO b) -> Benchmark
166+mkBenchSmall name env action =
167+ mkBenchCommon useSmallH (withScaling env name) env action
168+
169+ where
170+
171+ useSmallH (RefHandles {smallInH = inh, outputH = outh}) = Handles inh outh
114172
115173-------------------------------------------------------------------------------
116174-- read chunked using toChunks
@@ -191,31 +249,25 @@ inspect $ hasNoTypeClasses 'decodeUtf8Lenient
191249-- inspect $ 'decodeUtf8Lenient `hasNoType` ''D.ConcatMapUState
192250#endif
193251
194−o_1_space_read_chunked :: IORef Handles -> Handle -> Int -> [Benchmark]
195−o_1_space_read_chunked href _ _ =
252+o_1_space_read_chunked :: BenchEnv -> [Benchmark]
253+o_1_space_read_chunked env =
196254 -- read using toChunks instead of read
197255 [ bgroup "reduce/toChunks"
198− [ mkBench "S.last (32K)" href $ do
199− Handles inh _ <- readIORef href
200− toChunksLast inh
256+ [ mkBench "S.last (32K)" env $ \inH _ ->
257+ toChunksLast inH
201258 -- Note: this cannot be fairly compared with GNU wc -c or wc -m as
202259 -- wc uses lseek to just determine the file size rather than reading
203260 -- and counting characters.
204− , mkBench "S.sum . S.map A.length (32K)" href $ do
205− Handles inh _ <- readIORef href
206− toChunksSumLengths inh
207− , mkBench "AS.splitOnSuffix (32K)" href $ do
208− Handles inh _ <- readIORef href
209− toChunksSplitOnSuffix inh
210− , mkBench "AS.splitOn (32K)" href $ do
211− Handles inh _ <- readIORef href
212− toChunksSplitOn inh
213− , mkBench "countBytes (32K)" href $ do
214− Handles inh _ <- readIORef href
215− toChunksCountBytes inh
216− , mkBench "US.decodeUtf8ArraysLenient (1MB)" href $ do
217− Handles inh _ <- readIORef href
218− toChunksWithBufferOfDecodeUtf8ArraysLenient inh
261+ , mkBench "S.sum . S.map A.length (32K)" env $ \inH _ ->
262+ toChunksSumLengths inH
263+ , mkBench "AS.splitOnSuffix (32K)" env $ \inH _ ->
264+ toChunksSplitOnSuffix inH
265+ , mkBench "AS.splitOn (32K)" env $ \inH _ ->
266+ toChunksSplitOn inH
267+ , mkBench "countBytes (32K)" env $ \inH _ ->
268+ toChunksCountBytes inH
269+ , mkBenchSmall "US.decodeUtf8ArraysLenient (1MB)" env $ \inH _ ->
270+ toChunksWithBufferOfDecodeUtf8ArraysLenient inH
219271 ]
220272 ]
221273
@@ -228,7 +280,7 @@ o_1_space_read_chunked href _ _ =
228280-- | Send the file contents to /dev/null
229281{-# INLINE toChunksWithBufferOf #-}
230282toChunksWithBufferOf :: Handle -> Handle -> IO ()
231−toChunksWithBufferOf devNull inh =
283+toChunksWithBufferOf inh devNull =
232284 S.fold (IFH.writeChunks devNull) $ IFH.toChunksWithBufferOf (256*1024) inh
233285
234286#ifdef INSPECTION
@@ -264,18 +316,15 @@ inspect $ hasNoTypeClasses 'copyCodecUtf8ArraysLenient
264316-- inspect $ 'copyCodecUtf8ArraysLenient `hasNoType` ''D.ConcatMapUState
265317#endif
266318
267−o_1_space_copy_chunked :: IORef Handles -> Handle -> Int -> [Benchmark]
268−o_1_space_copy_chunked href devNull _ =
319+o_1_space_copy_chunked :: BenchEnv -> [Benchmark]
320+o_1_space_copy_chunked env =
269321 [ bgroup "copy/toChunks"
270− [ mkBench "toNull (256K)" href $ do
271− Handles inh _ <- readIORef href
272− toChunksWithBufferOf devNull inh
273− , mkBench "raw" href $ do
274− Handles inh outh <- readIORef href
275− copyChunks inh outh
276− , mkBench "decodeEncodeUtf8Lenient" href $ do
277− Handles inh outh <- readIORef href
278− copyCodecUtf8ArraysLenient inh outh
322+ [ mkBench "toNull (256K)" env $ \inH _ ->
323+ toChunksWithBufferOf inH (nullH env)
324+ , mkBench "raw" env $ \inH outH ->
325+ copyChunks inH outH
326+ , mkBenchSmall "decodeEncodeUtf8Lenient" env $ \inH outH ->
327+ copyCodecUtf8ArraysLenient inH outH
279328 ]
280329 ]
281330
@@ -288,7 +337,7 @@ o_1_space_copy_chunked href devNull _ =
288337-- | Send the file contents to /dev/null with exception handling
289338{-# INLINE readChunksWithBufferOfOnExceptionUnfold #-}
290339readChunksWithBufferOfOnExceptionUnfold :: Handle -> Handle -> IO ()
291−readChunksWithBufferOfOnExceptionUnfold devNull inh =
340+readChunksWithBufferOfOnExceptionUnfold inh devNull =
292341 let readEx = IUF.onException (\_ -> hClose inh)
293342 (IUF.supplyFirst FH.readChunksWithBufferOf (256*1024))
294343 in IUF.fold readEx (IFH.writeChunks devNull) inh
@@ -301,7 +350,7 @@ inspect $ hasNoTypeClasses 'readChunksWithBufferOfOnExceptionUnfold
301350-- | Send the file contents to /dev/null with exception handling
302351{-# INLINE readChunksWithBufferOfBracketUnfold #-}
303352readChunksWithBufferOfBracketUnfold :: Handle -> Handle -> IO ()
304−readChunksWithBufferOfBracketUnfold devNull inh =
353+readChunksWithBufferOfBracketUnfold inh devNull =
305354 let readEx = IUF.bracket return (\_ -> hClose inh)
306355 (IUF.supplyFirst FH.readChunksWithBufferOf (256*1024))
307356 in IUF.fold readEx (IFH.writeChunks devNull) inh
@@ -313,23 +362,20 @@ inspect $ hasNoTypeClasses 'readChunksWithBufferOfBracketUnfold
313362
314363{-# INLINE readChunksWithBufferOfBracketIOUnfold #-}
315364readChunksWithBufferOfBracketIOUnfold :: Handle -> Handle -> IO ()
316−readChunksWithBufferOfBracketIOUnfold devNull inh =
365+readChunksWithBufferOfBracketIOUnfold inh devNull =
317366 let readEx = IUF.bracketIO return (\_ -> hClose inh)
318367 (IUF.supplyFirst FH.readChunksWithBufferOf (256*1024))
319368 in IUF.fold readEx (IFH.writeChunks devNull) inh
320369
321−o_1_space_copy_exceptions_readChunks :: IORef Handles -> Handle -> Int -> [Benchmark]
322−o_1_space_copy_exceptions_readChunks href devNull _ =
370+o_1_space_copy_exceptions_readChunks :: BenchEnv -> [Benchmark]
371+o_1_space_copy_exceptions_readChunks env =
323372 [ bgroup "copy/exceptions/unfold/readChunks"
324− [ mkBench "onException (256K)" href $ do
325− Handles inh _ <- readIORef href
326− readChunksWithBufferOfOnExceptionUnfold devNull inh
327− , mkBench "bracket (256K)" href $ do
328− Handles inh _ <- readIORef href
329− readChunksWithBufferOfBracketUnfold devNull inh
330− , mkBench "bracketIO (256K)" href $ do
331− Handles inh _ <- readIORef href
332− readChunksWithBufferOfBracketIOUnfold devNull inh
373+ [ mkBench "onException (256K)" env $ \inH _ ->
374+ readChunksWithBufferOfOnExceptionUnfold inH (nullH env)
375+ , mkBench "bracket (256K)" env $ \inH _ ->
376+ readChunksWithBufferOfBracketUnfold inH (nullH env)
377+ , mkBench "bracketIO (256K)" env $ \inH _ ->
378+ readChunksWithBufferOfBracketIOUnfold inH (nullH env)
333379 ]
334380 ]
335381
@@ -340,7 +386,7 @@ o_1_space_copy_exceptions_readChunks href devNull _ =
340386-- | Send the file contents to /dev/null with exception handling
341387{-# INLINE toChunksWithBufferOfBracketStream #-}
342388toChunksWithBufferOfBracketStream :: Handle -> Handle -> IO ()
343−toChunksWithBufferOfBracketStream devNull inh =
389+toChunksWithBufferOfBracketStream inh devNull =
344390 let readEx = S.bracket (return ()) (\_ -> hClose inh)
345391 (\_ -> IFH.toChunksWithBufferOf (256*1024) inh)
346392 in S.fold (IFH.writeChunks devNull) $ readEx
@@ -352,20 +398,18 @@ inspect $ hasNoTypeClasses 'toChunksWithBufferOfBracketStream
352398
353399{-# INLINE toChunksWithBufferOfBracketIOStream #-}
354400toChunksWithBufferOfBracketIOStream :: Handle -> Handle -> IO ()
355−toChunksWithBufferOfBracketIOStream devNull inh =
401+toChunksWithBufferOfBracketIOStream inh devNull =
356402 let readEx = IP.bracketIO (return ()) (\_ -> hClose inh)
357403 (\_ -> IFH.toChunksWithBufferOf (256*1024) inh)
358404 in S.fold (IFH.writeChunks devNull) $ readEx
359405
360−o_1_space_copy_exceptions_toChunks :: IORef Handles -> Handle -> Int -> [Benchmark]
361−o_1_space_copy_exceptions_toChunks href devNull _ =
406+o_1_space_copy_exceptions_toChunks :: BenchEnv -> [Benchmark]
407+o_1_space_copy_exceptions_toChunks env =
362408 [ bgroup "copy/exceptions/stream/toChunks"
363− [ mkBench "bracket (256K)" href $ do
364− Handles inh _ <- readIORef href
365− toChunksWithBufferOfBracketStream devNull inh
366− , mkBench "bracketIO (256K)" href $ do
367− Handles inh _ <- readIORef href
368− toChunksWithBufferOfBracketIOStream devNull inh
409+ [ mkBench "bracket (256K)" env $ \inH _ ->
410+ toChunksWithBufferOfBracketStream inH (nullH env)
411+ , mkBench "bracketIO (256K)" env $ \inH _ ->
412+ toChunksWithBufferOfBracketIOStream inH (nullH env)
369413 ]
370414 ]
371415
@@ -466,37 +510,29 @@ inspect $ hasNoTypeClasses 'readDecodeUtf8Lax
466510-- inspect $ 'readDecodeUtf8Lax `hasNoType` ''D.ConcatMapUState
467511#endif
468512
469−o_1_space_reduce_read :: IORef Handles -> Handle -> Int -> [Benchmark]
470−o_1_space_reduce_read href _ _ =
513+o_1_space_reduce_read :: BenchEnv -> [Benchmark]
514+o_1_space_reduce_read env =
471515 [ bgroup "reduce/read"
472516 [ -- read raw bytes without any decoding
473− mkBench "S.drain" href $ do
474− Handles inh _ <- readIORef href
517+ mkBench "S.drain" env $ \inh _ ->
475518 readDrain inh
476− , mkBench "S.last" href $ do
477− Handles inh _ <- readIORef href
519+ , mkBench "S.last" env $ \inh _ ->
478520 readLast inh
479− , mkBench "S.sum" href $ do
480− Handles inh _ <- readIORef href
521+ , mkBench "S.sum" env $ \inh _ ->
481522 readSumBytes inh
482523
483524 -- read with Latin1 decoding
484− , mkBench "SS.decodeLatin1" href $ do
485− Handles inh _ <- readIORef href
525+ , mkBench "SS.decodeLatin1" env $ \inh _ ->
486526 readDecodeLatin1 inh
487− , mkBench "S.length" href $ do
488− Handles inh _ <- readIORef href
527+ , mkBench "S.length" env $ \inh _ ->
489528 readCountBytes inh
490− , mkBench "US.lines . SS.decodeLatin1" href $ do
491− Handles inh _ <- readIORef href
529+ , mkBench "US.lines . SS.decodeLatin1" env $ \inh _ ->
492530 readCountLines inh
493− , mkBench "US.words . SS.decodeLatin1" href $ do
494− Handles inh _ <- readIORef href
531+ , mkBenchSmall "US.words . SS.decodeLatin1" env $ \inh _ ->
495532 readCountWords inh
496533
497534 -- read with utf8 decoding
498− , mkBench "SS.decodeUtf8Lax" href $ do
499− Handles inh _ <- readIORef href
535+ , mkBenchSmall "SS.decodeUtf8Lax" env $ \inh _ ->
500536 readDecodeUtf8Lax inh
501537 ]
502538 ]
@@ -521,11 +557,10 @@ inspect $ 'countLinesU `hasNoType` ''Step
521557inspect $ 'countLinesU `hasNoType` ''D.ConcatMapUState
522558#endif
523559
524−o_1_space_reduce_toBytes :: IORef Handles -> Handle -> Int -> [Benchmark]
525−o_1_space_reduce_toBytes href _ _ =
560+o_1_space_reduce_toBytes :: BenchEnv -> [Benchmark]
561+o_1_space_reduce_toBytes env =
526562 [ bgroup "reduce/toBytes"
527− [ mkBench "US.lines . SS.decodeLatin1" href $ do
528− Handles inh _ <- readIORef href
563+ [ mkBench "US.lines . SS.decodeLatin1" env $ \inh _ ->
529564 toChunksConcatUnfoldCountLines inh
530565 ]
531566 ]
@@ -578,34 +613,28 @@ inspect $ '_chunksOfD `hasNoType` ''AT.FlattenState
578613inspect $ '_chunksOfD `hasNoType` ''D.ConcatMapUState
579614#endif
580615
581−o_1_space_reduce_read_grouped :: IORef Handles -> Handle -> Int -> [Benchmark]
582−o_1_space_reduce_read_grouped href _ value =
616+o_1_space_reduce_read_grouped :: BenchEnv -> [Benchmark]
617+o_1_space_reduce_read_grouped env =
583618 [ bgroup "reduce/read/chunks"
584− [ mkBench ("S.chunksOf " ++ show value ++ " FL.sum") href $ do
585− Handles inh _ <- readIORef href
586− chunksOfSum value inh
587− , mkBench "S.chunksOf 1 FL.sum" href $ do
588− Handles inh _ <- readIORef href
619+ [ mkBench ("S.chunksOf " ++ show (bigSize env) ++ " FL.sum") env $
620+ \inh _ ->
621+ chunksOfSum (bigSize env) inh
622+ , mkBench "S.chunksOf 1 FL.sum" env $ \inh _ ->
589623 chunksOfSum 1 inh
590624
591625 -- Chunk using parsers
592− , mkBench ("S.parseMany (PR.take " ++ show value ++ " FL.sum)")
593− href $ do
594− Handles inh _ <- readIORef href
595− parseManyChunksOfSum value inh
596− , mkBench "S.parseMany (PR.take 1 FL.sum)" href $ do
597− Handles inh _ <- readIORef href
626+ , mkBenchSmall ("S.parseMany (PR.take " ++ show (bigSize env) ++ " FL.sum)")
627+ env $ \inh _ ->
628+ parseManyChunksOfSum (bigSize env) inh
629+ , mkBench "S.parseMany (PR.take 1 FL.sum)" env $ \inh _ ->
598630 parseManyChunksOfSum 1 inh
599631
600632 -- folding chunks to arrays
601− , mkBench "S.arraysOf 1" href $ do
602− Handles inh _ <- readIORef href
633+ , mkBenchSmall "S.arraysOf 1" env $ \inh _ ->
603634 chunksOf 1 inh
604− , mkBench "S.arraysOf 10" href $ do
605− Handles inh _ <- readIORef href
635+ , mkBench "S.arraysOf 10" env $ \inh _ ->
606636 chunksOf 10 inh
607− , mkBench "S.arraysOf 1000" href $ do
608− Handles inh _ <- readIORef href
637+ , mkBench "S.arraysOf 1000" env $ \inh _ ->
609638 chunksOf 1000 inh
610639 ]
611640 ]
@@ -617,7 +646,7 @@ o_1_space_reduce_read_grouped href _ value =
617646-- | Send the file contents to /dev/null
618647{-# INLINE readWriteNull #-}
619648readWriteNull :: Handle -> Handle -> IO ()
620−readWriteNull devNull inh = S.fold (FH.write devNull) $ S.unfold FH.read inh
649+readWriteNull inh devNull = S.fold (FH.write devNull) $ S.unfold FH.read inh
621650
622651#ifdef INSPECTION
623652inspect $ hasNoTypeClasses 'readWriteNull
@@ -686,26 +715,21 @@ inspect $ hasNoTypeClasses 'copyStreamUtf8Lax
686715-- inspect $ 'copyStreamUtf8Lax `hasNoType` ''D.ConcatMapUState
687716#endif
688717
689−o_1_space_copy_read :: IORef Handles -> Handle -> Int -> [Benchmark]
690−o_1_space_copy_read href devNull _ =
718+o_1_space_copy_read :: BenchEnv -> [Benchmark]
719+o_1_space_copy_read env =
691720 [ bgroup "copy/read"
692− [ mkBench "rawToNull" href $ do
693− Handles inh _ <- readIORef href
694− readWriteNull devNull inh
695− , mkBench "rawToFile" href $ do
696− Handles inh outh <- readIORef href
721+ [ mkBench "rawToNull" env $ \inh _ ->
722+ readWriteNull inh (nullH env)
723+ , mkBench "rawToFile" env $ \inh outh ->
697724 copyStream inh outh
698725 -- This needs an ascii file, as decode just errors out.
699− , mkBench "SS.encodeLatin1 . SS.decodeLatin1" href $ do
700− Handles inh outh <- readIORef href
726+ , mkBench "SS.encodeLatin1 . SS.decodeLatin1" env $ \inh outh ->
701727 copyStreamLatin1 inh outh
702728#ifdef DEVBUILD
703− , mkBench "copyUtf8" href $ do
704− Handles inh outh <- readIORef href
729+ , mkBench "copyUtf8" env $ \inh outh ->
705730 _copyStreamUtf8 inh outh
706731#endif
707− , mkBench "SS.encodeUtf8 . SS.decodeUtf8Lax" href $ do
708− Handles inh outh <- readIORef href
732+ , mkBenchSmall "SS.encodeUtf8 . SS.decodeUtf8Lax" env $ \inh outh ->
709733 copyStreamUtf8Lax inh outh
710734 ]
711735 ]
@@ -717,7 +741,7 @@ o_1_space_copy_read href devNull _ =
717741-- | Send the file contents to /dev/null
718742{-# INLINE readFromBytesNull #-}
719743readFromBytesNull :: Handle -> Handle -> IO ()
720−readFromBytesNull devNull inh = IFH.fromBytes devNull $ S.unfold FH.read inh
744+readFromBytesNull inh devNull = IFH.fromBytes devNull $ S.unfold FH.read inh
721745
722746#ifdef INSPECTION
723747inspect $ hasNoTypeClasses 'catStreamWrite
@@ -726,12 +750,11 @@ inspect $ 'catStreamWrite `hasNoType` ''AT.FlattenState
726750inspect $ 'catStreamWrite `hasNoType` ''D.ConcatMapUState
727751#endif
728752
729−o_1_space_copy_fromBytes :: IORef Handles -> Handle -> Int -> [Benchmark]
730−o_1_space_copy_fromBytes href devNull _ =
753+o_1_space_copy_fromBytes :: BenchEnv -> [Benchmark]
754+o_1_space_copy_fromBytes env =
731755 [ bgroup "copy/fromBytes"
732− [ mkBench "rawToNull" href $ do
733− Handles inh _ <- readIORef href
734− readFromBytesNull devNull inh
756+ [ mkBench "rawToNull" env $ \inh _ ->
757+ readFromBytesNull inh (nullH env)
735758 ]
736759 ]
737760
@@ -742,7 +765,7 @@ o_1_space_copy_fromBytes href devNull _ =
742765-- | Send the file contents to /dev/null with exception handling
743766{-# INLINE readWriteOnExceptionUnfold #-}
744767readWriteOnExceptionUnfold :: Handle -> Handle -> IO ()
745−readWriteOnExceptionUnfold devNull inh =
768+readWriteOnExceptionUnfold inh devNull =
746769 let readEx = IUF.onException (\_ -> hClose inh) FH.read
747770 in S.fold (FH.write devNull) $ S.unfold readEx inh
748771
@@ -756,7 +779,7 @@ inspect $ hasNoTypeClasses 'readWriteOnExceptionUnfold
756779-- | Send the file contents to /dev/null with exception handling
757780{-# INLINE readWriteHandleExceptionUnfold #-}
758781readWriteHandleExceptionUnfold :: Handle -> Handle -> IO ()
759−readWriteHandleExceptionUnfold devNull inh =
782+readWriteHandleExceptionUnfold inh devNull =
760783 let handler (_e :: SomeException) = hClose inh >> return 10
761784 readEx = IUF.handle (IUF.singletonM handler) FH.read
762785 in S.fold (FH.write devNull) $ S.unfold readEx inh
@@ -771,7 +794,7 @@ inspect $ hasNoTypeClasses 'readWriteHandleExceptionUnfold
771794-- | Send the file contents to /dev/null with exception handling
772795{-# INLINE readWriteFinallyUnfold #-}
773796readWriteFinallyUnfold :: Handle -> Handle -> IO ()
774−readWriteFinallyUnfold devNull inh =
797+readWriteFinallyUnfold inh devNull =
775798 let readEx = IUF.finally (\_ -> hClose inh) FH.read
776799 in S.fold (FH.write devNull) $ S.unfold readEx inh
777800
@@ -784,14 +807,14 @@ inspect $ hasNoTypeClasses 'readWriteFinallyUnfold
784807
785808{-# INLINE readWriteFinallyIOUnfold #-}
786809readWriteFinallyIOUnfold :: Handle -> Handle -> IO ()
787−readWriteFinallyIOUnfold devNull inh =
810+readWriteFinallyIOUnfold inh devNull =
788811 let readEx = IUF.finallyIO (\_ -> hClose inh) FH.read
789812 in S.fold (FH.write devNull) $ S.unfold readEx inh
790813
791814-- | Send the file contents to /dev/null with exception handling
792815{-# INLINE readWriteBracketUnfold #-}
793816readWriteBracketUnfold :: Handle -> Handle -> IO ()
794−readWriteBracketUnfold devNull inh =
817+readWriteBracketUnfold inh devNull =
795818 let readEx = IUF.bracket return (\_ -> hClose inh) FH.read
796819 in S.fold (FH.write devNull) $ S.unfold readEx inh
797820
@@ -804,32 +827,25 @@ inspect $ hasNoTypeClasses 'readWriteBracketUnfold
804827
805828{-# INLINE readWriteBracketIOUnfold #-}
806829readWriteBracketIOUnfold :: Handle -> Handle -> IO ()
807−readWriteBracketIOUnfold devNull inh =
830+readWriteBracketIOUnfold inh devNull =
808831 let readEx = IUF.bracketIO return (\_ -> hClose inh) FH.read
809832 in S.fold (FH.write devNull) $ S.unfold readEx inh
810833
811−o_1_space_copy_read_exceptions ::
812− IORef Handles -> Handle -> Int -> [Benchmark]
813−o_1_space_copy_read_exceptions href devNull _ =
834+o_1_space_copy_read_exceptions :: BenchEnv -> [Benchmark]
835+o_1_space_copy_read_exceptions env =
814836 [ bgroup "copy/read/exceptions"
815− [ mkBench "UF.onException" href $ do
816− Handles inh _ <- readIORef href
817− readWriteOnExceptionUnfold devNull inh
818− , mkBench "UF.handle" href $ do
819− Handles inh _ <- readIORef href
820− readWriteHandleExceptionUnfold devNull inh
821− , mkBench "UF.finally" href $ do
822− Handles inh _ <- readIORef href
823− readWriteFinallyUnfold devNull inh
824− , mkBench "UF.finallyIO" href $ do
825− Handles inh _ <- readIORef href
826− readWriteFinallyIOUnfold devNull inh
827− , mkBench "UF.bracket" href $ do
828− Handles inh _ <- readIORef href
829− readWriteBracketUnfold devNull inh
830− , mkBench "UF.bracketIO" href $ do
831− Handles inh _ <- readIORef href
832− readWriteBracketIOUnfold devNull inh
837+ [ mkBenchSmall "UF.onException" env $ \inh _ ->
838+ readWriteOnExceptionUnfold inh (nullH env)
839+ , mkBenchSmall "UF.handle" env $ \inh _ ->
840+ readWriteHandleExceptionUnfold inh (nullH env)
841+ , mkBenchSmall "UF.finally" env $ \inh _ ->
842+ readWriteFinallyUnfold inh (nullH env)
843+ , mkBenchSmall "UF.finallyIO" env $ \inh _ ->
844+ readWriteFinallyIOUnfold inh (nullH env)
845+ , mkBenchSmall "UF.bracket" env $ \inh _ ->
846+ readWriteBracketUnfold inh (nullH env)
847+ , mkBenchSmall "UF.bracketIO" env $ \inh _ ->
848+ readWriteBracketIOUnfold inh (nullH env)
833849 ]
834850 ]
835851
@@ -840,14 +856,14 @@ o_1_space_copy_read_exceptions href devNull _ =
840856-- | Send the file contents to /dev/null with exception handling
841857{-# INLINE readWriteOnExceptionStream #-}
842858readWriteOnExceptionStream :: Handle -> Handle -> IO ()
843−readWriteOnExceptionStream devNull inh =
859+readWriteOnExceptionStream inh devNull =
844860 let readEx = S.onException (hClose inh) (S.unfold FH.read inh)
845861 in S.fold (FH.write devNull) $ readEx
846862
847863-- | Send the file contents to /dev/null with exception handling
848864{-# INLINE readWriteHandleExceptionStream #-}
849865readWriteHandleExceptionStream :: Handle -> Handle -> IO ()
850−readWriteHandleExceptionStream devNull inh =
866+readWriteHandleExceptionStream inh devNull =
851867 let handler (_e :: SomeException) = S.yieldM (hClose inh >> return 10)
852868 readEx = S.handle handler (S.unfold FH.read inh)
853869 in S.fold (FH.write devNull) $ readEx
@@ -855,20 +871,20 @@ readWriteHandleExceptionStream devNull inh =
855871-- | Send the file contents to /dev/null with exception handling
856872{-# INLINE readWriteFinallyStream #-}
857873readWriteFinallyStream :: Handle -> Handle -> IO ()
858−readWriteFinallyStream devNull inh =
874+readWriteFinallyStream inh devNull =
859875 let readEx = S.finally (hClose inh) (S.unfold FH.read inh)
860876 in S.fold (FH.write devNull) readEx
861877
862878{-# INLINE readWriteFinallyIOStream #-}
863879readWriteFinallyIOStream :: Handle -> Handle -> IO ()
864−readWriteFinallyIOStream devNull inh =
880+readWriteFinallyIOStream inh devNull =
865881 let readEx = IP.finallyIO (hClose inh) (S.unfold FH.read inh)
866882 in S.fold (FH.write devNull) readEx
867883
868884-- | Send the file contents to /dev/null with exception handling
869885{-# INLINE fromToBytesBracketStream #-}
870886fromToBytesBracketStream :: Handle -> Handle -> IO ()
871−fromToBytesBracketStream devNull inh =
887+fromToBytesBracketStream inh devNull =
872888 let readEx = S.bracket (return ()) (\_ -> hClose inh)
873889 (\_ -> IFH.toBytes inh)
874890 in IFH.fromBytes devNull $ readEx
@@ -880,35 +896,28 @@ inspect $ hasNoTypeClasses 'readWriteBracketStream
880896
881897{-# INLINE fromToBytesBracketIOStream #-}
882898fromToBytesBracketIOStream :: Handle -> Handle -> IO ()
883−fromToBytesBracketIOStream devNull inh =
899+fromToBytesBracketIOStream inh devNull =
884900 let readEx = IP.bracketIO (return ()) (\_ -> hClose inh)
885901 (\_ -> IFH.toBytes inh)
886902 in IFH.fromBytes devNull $ readEx
887903
888−o_1_space_copy_stream_exceptions ::
889− IORef Handles -> Handle -> Int -> [Benchmark]
890−o_1_space_copy_stream_exceptions href devNull _ =
904+o_1_space_copy_stream_exceptions :: BenchEnv -> [Benchmark]
905+o_1_space_copy_stream_exceptions env =
891906 [ bgroup "copy/read/exceptions"
892− [ mkBench "S.onException" href $ do
893− Handles inh _ <- readIORef href
894− readWriteOnExceptionStream devNull inh
895− , mkBench "S.handle" href $ do
896− Handles inh _ <- readIORef href
897− readWriteHandleExceptionStream devNull inh
898− , mkBench "S.finally" href $ do
899− Handles inh _ <- readIORef href
900− readWriteFinallyStream devNull inh
901− , mkBench "S.finallyIO" href $ do
902− Handles inh _ <- readIORef href
903− readWriteFinallyIOStream devNull inh
907+ [ mkBenchSmall "S.onException" env $ \inh _ ->
908+ readWriteOnExceptionStream inh (nullH env)
909+ , mkBenchSmall "S.handle" env $ \inh _ ->
910+ readWriteHandleExceptionStream inh (nullH env)
911+ , mkBenchSmall "S.finally" env $ \inh _ ->
912+ readWriteFinallyStream inh (nullH env)
913+ , mkBenchSmall "S.finallyIO" env $ \inh _ ->
914+ readWriteFinallyIOStream inh (nullH env)
904915 ]
905916 , bgroup "copy/fromToBytes/exceptions"
906− [ mkBench "S.bracket" href $ do
907− Handles inh _ <- readIORef href
908− fromToBytesBracketStream devNull inh
909− , mkBench "S.bracketIO" href $ do
910− Handles inh _ <- readIORef href
911− fromToBytesBracketIOStream devNull inh
917+ [ mkBenchSmall "S.bracket" env $ \inh _ ->
918+ fromToBytesBracketStream inh (nullH env)
919+ , mkBenchSmall "S.bracketIO" env $ \inh _ ->
920+ fromToBytesBracketIOStream inh (nullH env)
912921 ]
913922 ]
914923
@@ -945,15 +954,12 @@ inspect $ hasNoTypeClassesExcept 'copyChunksSplitInterpose [''Storable]
945954-- inspect $ 'copyChunksSplitInterpose `hasNoType` ''Step
946955#endif
947956
948−o_1_space_copy_toChunks_group_ungroup ::
949− IORef Handles -> Handle -> Int -> [Benchmark]
950−o_1_space_copy_toChunks_group_ungroup href _ _ =
957+o_1_space_copy_toChunks_group_ungroup :: BenchEnv -> [Benchmark]
958+o_1_space_copy_toChunks_group_ungroup env =
951959 [ bgroup "copy/toChunks/group-ungroup"
952− [ mkBench "AS.interposeSuffix . AS.splitOnSuffix" href $ do
953− Handles inh outh <- readIORef href
960+ [ mkBench "AS.interposeSuffix . AS.splitOnSuffix" env $ \inh outh ->
954961 copyChunksSplitInterposeSuffix inh outh
955− , mkBench "AS.interpose . AS.splitOn" href $ do
956− Handles inh outh <- readIORef href
962+ , mkBenchSmall "AS.interpose . AS.splitOn" env $ \inh outh ->
957963 copyChunksSplitInterpose inh outh
958964 ]
959965 ]
@@ -1086,29 +1092,22 @@ wordsUnwordsCharArrayCopy inh outh =
10861092 $ SS.decodeLatin1
10871093 $ S.unfold FH.read inh
10881094
1089−o_1_space_copy_read_group_ungroup ::
1090− IORef Handles -> Handle -> Int -> [Benchmark]
1091−o_1_space_copy_read_group_ungroup href _ _ =
1095+o_1_space_copy_read_group_ungroup :: BenchEnv -> [Benchmark]
1096+o_1_space_copy_read_group_ungroup env =
10921097 [ bgroup "copy/read/group-ungroup"
1093− [ mkBench "US.unlines . S.splitOnSuffix ([Word8])" href $ do
1094− Handles inh outh <- readIORef href
1095− linesUnlinesCopy inh outh
1096− , mkBench "S.interposeSuffix . S.splitOnSuffix(Array Word8)" href $ do
1097− Handles inh outh <- readIORef href
1098− linesUnlinesArrayWord8Copy inh outh
1099− , mkBench "UA.unlines . UA.lines (Array Char)" href $ do
1100− Handles inh outh <- readIORef href
1101− linesUnlinesArrayCharCopy inh outh
1102−
1103− , mkBench "S.interposeSuffix . S.wordsBy ([Word8])" href $ do
1104− Handles inh outh <- readIORef href
1105− wordsUnwordsCopyWord8 inh outh
1106− , mkBench "US.unwords . S.wordsBy ([Char])" href $ do
1107− Handles inh outh <- readIORef href
1108− wordsUnwordsCopy inh outh
1109− , mkBench "UA.unwords . UA.words (Array Char)" href $ do
1110− Handles inh outh <- readIORef href
1111− wordsUnwordsCharArrayCopy inh outh
1098+ [ mkBenchSmall "US.unlines . S.splitOnSuffix ([Word8])" env
1099+ $ \inh outh -> linesUnlinesCopy inh outh
1100+ , mkBenchSmall "S.interposeSuffix . S.splitOnSuffix(Array Word8)" env
1101+ $ \inh outh -> linesUnlinesArrayWord8Copy inh outh
1102+ , mkBenchSmall "UA.unlines . UA.lines (Array Char)" env
1103+ $ \inh outh -> linesUnlinesArrayCharCopy inh outh
1104+
1105+ , mkBenchSmall "S.interposeSuffix . S.wordsBy ([Word8])" env
1106+ $ \inh outh -> wordsUnwordsCopyWord8 inh outh
1107+ , mkBenchSmall "US.unwords . S.wordsBy ([Char])" env
1108+ $ \inh outh -> wordsUnwordsCopy inh outh
1109+ , mkBenchSmall "UA.unwords . UA.words (Array Char)" env
1110+ $ \inh outh -> wordsUnwordsCharArrayCopy inh outh
11121111 ]
11131112 ]
11141113
@@ -1199,66 +1198,45 @@ splitOnSuffixSeq str inh =
11991198-- inspect $ 'splitOnSuffixSeq `hasNoType` ''D.ConcatMapUState
12001199#endif
12011200
1202−o_1_space_reduce_read_split ::
1203− IORef Handles -> Handle -> Int -> [Benchmark]
1204−o_1_space_reduce_read_split href _ _ =
1201+o_1_space_reduce_read_split :: BenchEnv -> [Benchmark]
1202+o_1_space_reduce_read_split env =
12051203 [ bgroup "reduce/read"
1206− [ mkBench "S.parseMany (PR.sliceSepBy (== lf) FL.drain)" href $ do
1207− Handles inh _ <- readIORef href
1208− parseManySepBy inh
1209− , mkBench "S.wordsBy isSpace FL.drain" href $ do
1210− Handles inh _ <- readIORef href
1204+ [ mkBench "S.parseMany (PR.sliceSepBy (== lf) FL.drain)" env
1205+ $ \inh _ -> parseManySepBy inh
1206+ , mkBench "S.wordsBy isSpace FL.drain" env $ \inh _ ->
12111207 wordsBy inh
1212− , mkBench "S.splitOn (== lf) FL.drain" href $ do
1213− Handles inh _ <- readIORef href
1208+ , mkBench "S.splitOn (== lf) FL.drain" env $ \inh _ ->
12141209 splitOn inh
1215− , mkBench "S.splitOnSuffix (== lf) FL.drain" href $ do
1216− Handles inh _ <- readIORef href
1210+ , mkBench "S.splitOnSuffix (== lf) FL.drain" env $ \inh _ ->
12171211 splitOnSuffix inh
1218− , mkBench "S.splitOnSeq \"\" FL.drain" href $ do
1219− Handles inh _ <- readIORef href
1212+ , mkBench "S.splitOnSeq \"\" FL.drain" env $ \inh _ ->
12201213 splitOnSeq "" inh
1221− , mkBench "S.splitOnSuffixSeq \"\" FL.drain" href $ do
1222− Handles inh _ <- readIORef href
1214+ , mkBench "S.splitOnSuffixSeq \"\" FL.drain" env $ \inh _ ->
12231215 splitOnSuffixSeq "" inh
1224− , mkBench "S.splitOnSeq \"\\n\" FL.drain" href $ do
1225− Handles inh _ <- readIORef href
1216+ , mkBench "S.splitOnSeq \"\\n\" FL.drain" env $ \inh _ ->
12261217 splitOnSeq "\n" inh
1227− , mkBench "S.splitOnSuffixSeq \"\\n\" FL.drain" href $ do
1228− Handles inh _ <- readIORef href
1218+ , mkBench "S.splitOnSuffixSeq \"\\n\" FL.drain" env $ \inh _ ->
12291219 splitOnSuffixSeq "\n" inh
1230− , mkBench "S.splitOnSeq \"a\" FL.drain" href $ do
1231− Handles inh _ <- readIORef href
1220+ , mkBench "S.splitOnSeq \"a\" FL.drain" env $ \inh _ ->
12321221 splitOnSeq "a" inh
1233− , mkBench "S.splitOnSeq \"\\r\\n\" FL.drain" href $ do
1234− Handles inh _ <- readIORef href
1222+ , mkBench "S.splitOnSeq \"\\r\\n\" FL.drain" env $ \inh _ ->
12351223 splitOnSeq "\r\n" inh
1236− , mkBench "S.splitOnSuffixSeq \"\\r\\n\" FL.drain" href $ do
1237− Handles inh _ <- readIORef href
1224+ , mkBench "S.splitOnSuffixSeq \"\\r\\n\" FL.drain" env $ \inh _ ->
12381225 splitOnSuffixSeq "\r\n" inh
1239− , mkBench "S.splitOnSeq \"aa\" FL.drain" href $ do
1240− Handles inh _ <- readIORef href
1226+ , mkBench "S.splitOnSeq \"aa\" FL.drain" env $ \inh _ ->
12411227 splitOnSeq "aa" inh
1242− , mkBench "S.splitOnSeq \"aaaa\" FL.drain" href $ do
1243− Handles inh _ <- readIORef href
1228+ , mkBench "S.splitOnSeq \"aaaa\" FL.drain" env $ \inh _ ->
12441229 splitOnSeq "aaaa" inh
1245− , mkBench "S.splitOnSeq \"abcdefgh\" FL.drain" href $ do
1246− Handles inh _ <- readIORef href
1230+ , mkBench "S.splitOnSeq \"abcdefgh\" FL.drain" env $ \inh _ ->
12471231 splitOnSeq "abcdefgh" inh
1248− , mkBench "S.splitOnSeq \"abcdefghi\" FL.drain" href $ do
1249− Handles inh _ <- readIORef href
1232+ , mkBench "S.splitOnSeq \"abcdefghi\" FL.drain" env $ \inh _ ->
12501233 splitOnSeq "abcdefghi" inh
1251− , mkBench "S.splitOnSeq \"catcatcatcatcat\" FL.drain" href $ do
1252− Handles inh _ <- readIORef href
1234+ , mkBench "S.splitOnSeq \"catcatcatcatcat\" FL.drain" env $ \inh _ ->
12531235 splitOnSeq "catcatcatcatcat" inh
12541236 , mkBench "S.splitOnSeq \"abcdefghijklmnopqrstuvwxyz\" FL.drain"
1255− href $ do
1256− Handles inh _ <- readIORef href
1257− splitOnSeq "abcdefghijklmnopqrstuvwxyz" inh
1258− , mkBench "S.splitOnSuffixSeq \"abcdefghijklmnopqrstuvwxyz\" FL.drain"
1259− href $ do
1260− Handles inh _ <- readIORef href
1261− splitOnSuffixSeq "abcdefghijklmnopqrstuvwxyz" inh
1237+ env $ \inh _ -> splitOnSeq "abcdefghijklmnopqrstuvwxyz" inh
1238+ , mkBenchSmall "S.splitOnSuffixSeq \"abcdefghijklmnopqrstuvwxyz\" FL.drain"
1239+ env $ \inh _ -> splitOnSuffixSeq "abcdefghijklmnopqrstuvwxyz" inh
12621240 ]
12631241 ]
12641242
@@ -1270,18 +1248,14 @@ splitOnSeqUtf8 str inh =
12701248 $ IUS.decodeUtf8ArraysLenient
12711249 $ IFH.toChunks inh) -- >>= print
12721250
1273−o_1_space_reduce_toChunks_split ::
1274− IORef Handles -> Handle -> Int -> [Benchmark]
1275−o_1_space_reduce_toChunks_split href _ _ =
1251+o_1_space_reduce_toChunks_split :: BenchEnv -> [Benchmark]
1252+o_1_space_reduce_toChunks_split env =
12761253 [ bgroup "reduce/toChunks"
1277− [ mkBench ("S.splitOnSeqUtf8 \"abcdefgh\" FL.drain "
1278− ++ ". US.decodeUtf8ArraysLenient") href $ do
1279− Handles inh _ <- readIORef href
1254+ [ mkBenchSmall ("S.splitOnSeqUtf8 \"abcdefgh\" FL.drain "
1255+ ++ ". US.decodeUtf8ArraysLenient") env $ \inh _ ->
12801256 splitOnSeqUtf8 "abcdefgh" inh
1281− , mkBench "S.splitOnSeqUtf8 \"abcdefghijklmnopqrstuvwxyz\" FL.drain"
1282− href $ do
1283− Handles inh _ <- readIORef href
1284− splitOnSeqUtf8 "abcdefghijklmnopqrstuvwxyz" inh
1257+ , mkBenchSmall "S.splitOnSeqUtf8 \"abcdefghijklmnopqrstuvwxyz\" FL.drain"
1258+ env $ \inh _ -> splitOnSeqUtf8 "abcdefghijklmnopqrstuvwxyz" inh
12851259 ]
12861260 ]
12871261
@@ -1292,13 +1266,8 @@ o_1_space_reduce_toChunks_split href _ _ =
12921266main :: IO ()
12931267main = do
12941268 (_, cfg, benches) <- parseCLIOpts defaultStreamSize
1295−
1296− -- XXX The file is cached, so if the older file was a different size it
1297− -- will not be correct
1298− -- fileSize = blockSize * blockCount
1299−
13001269 r <- lookupEnv "Benchmark.FileSystem.Handle.InputFile"
1301− (_, big) <-
1270+ (small, big) <-
13021271 case r of
13031272 Just inFileName -> return (inFileName, inFileName)
13041273 Nothing -> do
@@ -1315,37 +1284,54 @@ main = do
13151284 runProcess_ (shell (cmd inFileBig bigFileSize))
13161285 return (inFileSmall, inFileBig)
13171286
1318− -- smallHandle <- openFile small ReadMode
1287+ smallHandle <- openFile small ReadMode
13191288 bigHandle <- openFile big ReadMode
13201289 outHandle <- openFile outfile WriteMode
13211290 devNull <- openFile "/dev/null" WriteMode
13221291
1323− -- ssize <- getFileSize small
1324− bsize <- getFileSize big
1292+#if __GLASGOW_HASKELL__ >= 800
1293+ ssize <- fromIntegral <$> getFileSize small
1294+ bsize <- fromIntegral <$> getFileSize big
1295+#else
1296+ let ssize = smallFileSize
1297+ let bsize = bigFileSize
1298+#endif
1299+
1300+ ref <- newIORef $ RefHandles
1301+ { smallInH = smallHandle
1302+ , bigInH = bigHandle
1303+ , outputH = outHandle
1304+ }
1305+
1306+ let env = BenchEnv
1307+ { href = ref
1308+ , smallSize = ssize
1309+ , bigSize = bsize
1310+ , nullH = devNull
1311+ }
13251312
1326− ref <- newIORef $ Handles bigHandle outHandle
1327− runMode (mode cfg) cfg benches (allBenchmarks ref devNull (fromIntegral bsize))
1313+ runMode (mode cfg) cfg benches (allBenchmarks env)
13281314
13291315 where
13301316
1331− allBenchmarks env devNull bsize =
1317+ allBenchmarks env =
13321318 [ bgroup (o_1_space_prefix moduleName) $ Prelude.concat
1333− [ o_1_space_read_chunked env devNull bsize
1334− , o_1_space_copy_chunked env devNull bsize
1335− , o_1_space_copy_exceptions_readChunks env devNull bsize
1336− , o_1_space_copy_exceptions_toChunks env devNull bsize
1337−
1338− , o_1_space_reduce_read env devNull bsize
1339− , o_1_space_reduce_toBytes env devNull bsize
1340− , o_1_space_reduce_read_grouped env devNull bsize
1341− , o_1_space_reduce_read_split env devNull bsize
1342− , o_1_space_reduce_toChunks_split env devNull bsize
1343−
1344− , o_1_space_copy_read env devNull bsize
1345− , o_1_space_copy_fromBytes env devNull bsize
1346− , o_1_space_copy_read_exceptions env devNull bsize
1347− , o_1_space_copy_stream_exceptions env devNull bsize
1348− , o_1_space_copy_read_group_ungroup env devNull bsize
1349− , o_1_space_copy_toChunks_group_ungroup env devNull bsize
1319+ [ o_1_space_read_chunked env
1320+ , o_1_space_copy_chunked env
1321+ , o_1_space_copy_exceptions_readChunks env
1322+ , o_1_space_copy_exceptions_toChunks env
1323+
1324+ , o_1_space_reduce_read env
1325+ , o_1_space_reduce_toBytes env
1326+ , o_1_space_reduce_read_grouped env
1327+ , o_1_space_reduce_read_split env
1328+ , o_1_space_reduce_toChunks_split env
1329+
1330+ , o_1_space_copy_read env
1331+ , o_1_space_copy_fromBytes env
1332+ , o_1_space_copy_read_exceptions env
1333+ , o_1_space_copy_stream_exceptions env
1334+ , o_1_space_copy_toChunks_group_ungroup env
1335+ , o_1_space_copy_read_group_ungroup env
13501336 ]
13511337 ]