Skip to content

Commit 4271ccc

Browse files
authored
Merge pull request #19 from cmp0st/buffered-io
Remove unnecessary IO Flush to improve column temp file write performance
2 parents deeacf2 + a91dde4 commit 4271ccc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Data/DataFrame/IO.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Data.List (transpose, foldl')
3535
import Data.Maybe ( fromMaybe )
3636
import GHC.IO (unsafePerformIO)
3737
import GHC.IO.Handle
38-
( hClose, hFlush, hSeek, SeekMode(AbsoluteSeek), hIsEOF )
38+
( hClose, hSeek, SeekMode(AbsoluteSeek), hIsEOF )
3939
import GHC.IO.Handle.Types (Handle)
4040
import GHC.Stack (HasCallStack)
4141
import Text.Read (readMaybe)
@@ -103,7 +103,7 @@ mkColumns :: Char -> [(String, Handle)] -> Handle -> IO ()
103103
mkColumns c tmpFiles inputHandle = do
104104
row <- TIO.hGetLine inputHandle
105105
let splitRow = split c row
106-
zipWithM_ (\s (f, h) -> TIO.hPutStrLn h s >> hFlush h) splitRow tmpFiles
106+
zipWithM_ (\s (f, h) -> TIO.hPutStrLn h s) splitRow tmpFiles
107107
isEOF <- hIsEOF inputHandle
108108
if isEOF then return () else mkColumns c tmpFiles inputHandle
109109

0 commit comments

Comments
 (0)