Skip to content

Commit eebec5f

Browse files
committed
Add INLINE statements to directory tree helper functions
1 parent fb742b1 commit eebec5f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bench-test-lib/src/BenchTestLib/DirIO.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ createDirStucture dirRoot depth width = do
124124

125125
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
126126
-- Fastest implementation, only works for posix as of now.
127+
{-# INLINE listDirByteChunked #-}
127128
listDirByteChunked :: FilePath -> Stream IO (Array Word8)
128129
listDirByteChunked inp = do
129130
Stream.catRights
@@ -132,6 +133,7 @@ listDirByteChunked inp = do
132133
#endif
133134

134135
-- Faster than the listDir implementation below
136+
{-# INLINE listDirChunkedWith #-}
135137
listDirChunkedWith
136138
:: (Stream IO (Either [Path] b) -> Stream IO (Either [Path] [Path]))
137139
-> [Char] -> Stream IO Word8
@@ -143,6 +145,7 @@ listDirChunkedWith act inp = do
143145
$ act
144146
$ Stream.fromPure (Left [fromJust $ Path.fromString inp])
145147

148+
{-# INLINE listDirWith #-}
146149
listDirWith
147150
:: (Stream IO (Either Path Path) -> Stream IO (Either Path Path))
148151
-> [Char] -> Stream IO Word8
@@ -153,6 +156,7 @@ listDirWith act inp = do
153156
$ Stream.fromPure (Left (fromJust $ Path.fromString inp))
154157

155158
#define DEF_LIST_DIR(x,y); \
159+
{-# INLINE x #-} \
156160
x :: [Char] -> Stream IO Word8;\
157161
x = listDirWith (y)
158162

@@ -169,6 +173,7 @@ DEF_LIST_DIR(listDirParInterleaved, Stream.parConcatIterate (Stream.interleaved
169173
DEF_LIST_DIR(listDirParOrdered, Stream.parConcatIterate (Stream.ordered True) streamDir)
170174

171175
#define DEF_LIST_DIR_CHUNKED(x,y); \
176+
{-# INLINE x #-} \
172177
x :: [Char] -> Stream IO Word8;\
173178
x = listDirChunkedWith (y)
174179

0 commit comments

Comments
 (0)