diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-29 19:04:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-29 19:04:24 -0400 |
commit | a91c8a15d523791ea729976cd5c76bac1e7ec135 (patch) | |
tree | 32fcd0deaa1694f25ab3747f355264dd29d20636 /Git.hs | |
parent | 244ffef43f859152907f5202e85161f3e73cfe64 (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.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |