summaryrefslogtreecommitdiff
path: root/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-29 19:04:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-29 19:04:24 -0400
commita91c8a15d523791ea729976cd5c76bac1e7ec135 (patch)
tree32fcd0deaa1694f25ab3747f355264dd29d20636 /Git.hs
parent244ffef43f859152907f5202e85161f3e73cfe64 (diff)
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.
Diffstat (limited to 'Git.hs')
-rw-r--r--Git.hs5
1 files changed, 3 insertions, 2 deletions
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