@@ -32,45 +32,48 @@ import BenchTestLib.DirIO
3232moduleName :: String
3333moduleName = " FileSystem.DirIO"
3434
35- #define BENCH(x) \
35+ #define BENCH(x,fp ) \
3636bench " x " $ nfIO $ \
37- Stream. fold Fold. drain $ x dirRoot
37+ Stream. fold Fold. drain $ x fp
3838
3939-- | List the current directory recursively
4040main :: IO ()
4141main = do
4242 setLocaleEncoding utf8
4343
44- let dirRoot = " benchmark-tmp/dir-structure"
45- createDirStucture dirRoot
44+ let smallTree = " benchmark-tmp/dir-structure-small"
45+ bigTree = " benchmark-tmp/dir-structure-big"
46+ createDirStucture smallTree 2 3
47+ createDirStucture bigTree 5 5
4648
4749 defaultMain
4850 [ bgroup (o_1_space_prefix moduleName)
4951#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
5052 $ (bench " listDirByteChunked" $ nfIO $
51- Stream. fold Fold. drain $ listDirByteChunked dirRoot ) :
53+ Stream. fold Fold. drain $ listDirByteChunked bigTree ) :
5254#endif
53- [ BENCH (listDirUnfoldDfs)
54- -- NOTE: The BFS traversal fails with:
55- -- openDirStream: resource exhausted (Too many open files)
56- , BENCH (listDirUnfoldDfs)
57- -- , BENCH(listDirUnfoldBfs)
58- -- , BENCH(listDirUnfoldBfsRev)
59- , BENCH (listDirConcatDfs)
60- -- , BENCH(listDirConcatBfs)
61- -- , BENCH(listDirConcatBfsRev)
62- , BENCH (listDirAppend)
63- , BENCH (listDirInterleave)
64- , BENCH (listDirPar)
65- , BENCH (listDirParInterleaved)
66- , BENCH (listDirParOrdered)
67- , BENCH (listDirChunkDfs)
68- -- , BENCH(listDirChunkBfs)
69- -- , BENCH(listDirChunkBfsRev)
70- , BENCH (listDirChunkAppend)
71- , BENCH (listDirChunkInterleave)
72- , BENCH (listDirChunkPar)
73- , BENCH (listDirChunkParInterleaved)
74- , BENCH (listDirChunkParOrdered)
55+ -- NOTE: The BFS traversal fails with:
56+ -- openDirStream: resource exhausted (Too many open files)
57+ -- if a bigger directory tree is used
58+ [ BENCH (listDirUnfoldDfs,bigTree)
59+ , BENCH (listDirUnfoldDfs,bigTree)
60+ , BENCH (listDirUnfoldBfs,smallTree)
61+ , BENCH (listDirUnfoldBfsRev,smallTree)
62+ , BENCH (listDirConcatDfs,bigTree)
63+ , BENCH (listDirConcatBfs,smallTree)
64+ , BENCH (listDirConcatBfsRev,smallTree)
65+ , BENCH (listDirAppend,bigTree)
66+ , BENCH (listDirInterleave,bigTree)
67+ , BENCH (listDirPar,bigTree)
68+ , BENCH (listDirParInterleaved,bigTree)
69+ , BENCH (listDirParOrdered,bigTree)
70+ , BENCH (listDirChunkDfs,bigTree)
71+ , BENCH (listDirChunkBfs,smallTree)
72+ , BENCH (listDirChunkBfsRev,smallTree)
73+ , BENCH (listDirChunkAppend,bigTree)
74+ , BENCH (listDirChunkInterleave,bigTree)
75+ , BENCH (listDirChunkPar,bigTree)
76+ , BENCH (listDirChunkParInterleaved,bigTree)
77+ , BENCH (listDirChunkParOrdered,bigTree)
7578 ]
7679 ]
0 commit comments