From a91c8a15d523791ea729976cd5c76bac1e7ec135 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 29 Sep 2011 19:04:24 -0400 Subject: Sped up unused. Added Git.ByteString which replaces Git IO methods with ones using lazy ByteStrings. This can be more efficient when large quantities of data are being read from git. In Git.LsTree, parse git ls-tree output more efficiently, thanks to ByteString. This benchmarks 25% faster, in a benchmark that includes (probably predominately) the run time for git ls-tree itself. In real world numbers, this makes git annex unused 2 seconds faster for each branch it needs to check, in my usual large repo. --- Git.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Git.hs') diff --git a/Git.hs b/Git.hs index fe2afdcfe..f49cc21b5 100644 --- a/Git.hs +++ b/Git.hs @@ -59,6 +59,7 @@ module Git ( getSha, shaSize, commit, + assertLocal, prop_idempotent_deencode ) where @@ -458,8 +459,8 @@ commit g message newref parentrefs = do ps = concatMap (\r -> ["-p", r]) parentrefs {- Reads null terminated output of a git command (as enabled by the -z - - parameter), and splits it into a list of files/lines/whatever. -} -pipeNullSplit :: Repo -> [CommandParam] -> IO [FilePath] + - parameter), and splits it. -} +pipeNullSplit :: Repo -> [CommandParam] -> IO [String] pipeNullSplit repo params = filter (not . null) . split "\0" <$> pipeRead repo params -- cgit v1.2.3