convert all git read/write functions to use ByteStrings

This yields a second or so speedup in unused, find, etc. Seems that even
when the ByteString is immediately split and then converted to Strings,
it's faster.

I may try to push ByteStrings out into more of git-annex gradually,
although I suspect most of the time-critical parts are already covered
now, and many of the rest rely on libraries that only support Strings.
This commit is contained in:
Joey Hess 2011-09-29 23:43:42 -04:00
parent 949ef94d5e
commit 7ff89ccfee
8 changed files with 49 additions and 94 deletions

View file

@ -16,6 +16,7 @@ import Data.Maybe
import System.FilePath
import System.Directory
import Data.List
import qualified Data.ByteString.Lazy.Char8 as L
import Command
import Types
@ -172,7 +173,7 @@ excludeReferenced l = do
refs = map last .
nubBy cmpheads .
filter ourbranches .
map words . lines
map words . lines . L.unpack
cmpheads a b = head a == head b
ourbranchend = '/' : Branch.name
ourbranches ws = not $ ourbranchend `isSuffixOf` last ws