update based on profiling
While L.toStrict copies, profiling showed it was only around 0.3% of git-annex find runtime. Does not seem worth optimising that, which would probably involve either a major refactoring, or a use of UnsafeInterleaveIO. Also, it seems to me that the latter would need to read chunks, and preappend the leftover part to the next chunk. But a strict ByteString append itself is a copy, so I'm not convinced that would be faster than L.toStrict.
This commit is contained in:
parent
c914058bf9
commit
d830386ab2
2 changed files with 4 additions and 7 deletions
|
@ -101,10 +101,8 @@ pipeNullSplit params repo = do
|
|||
(s, cleanup) <- pipeReadLazy params repo
|
||||
return (filter (not . L.null) $ L.split 0 s, cleanup)
|
||||
|
||||
{- Reads lazily, but converts each part to a strict ByteString for
|
||||
{- Reads lazily, but copies each part to a strict ByteString for
|
||||
- convenience.
|
||||
-
|
||||
- FIXME the L.toStrict makes a copy, more expensive than ideal.
|
||||
-}
|
||||
pipeNullSplit' :: [CommandParam] -> Repo -> IO ([S.ByteString], IO Bool)
|
||||
pipeNullSplit' params repo = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue