on master help sign in
Add a few handy SCCs
8028b36Bryan O'Sullivan
tests/benchmarks/FileRead.hs+9−3
@@ -12,13 +12,19 @@ string :: FilePath -> IO ()
12string file = readFile file >>= print . length
12string file = readFile file >>= print . length
13
13
14text :: FilePath -> IO ()
14text :: FilePath -> IO ()
15+text file = do
16+ t <- {-# SCC "T.readFile" #-} T.readFile file
15−text file = T.readFile file >>= print . T.length
17+ print (T.length t)
16
18
17textBS :: FilePath -> IO ()
19textBS :: FilePath -> IO ()
20+textBS file = do
21+ bs <- {-# SCC "B.readFile" #-} B.readFile file
18−textBS file = B.readFile file >>= print . T.length . T.decodeUtf8
22+ print . T.length . T.decodeUtf8 $ bs
19
23
20bytestring :: FilePath -> IO ()
24bytestring :: FilePath -> IO ()
21−bytestring file = B.readFile file >>= print . B.length
25+bytestring file = do
26+ bs <- {-# SCC "B.readFile" #-}B.readFile file
27+ print (B.length bs)
22
28
23main = do
29main = do
24 (name : file : _) <- getArgs
30 (name : file : _) <- getArgs