Sped back up fsck, copy --from etc

All commands that often have to read a lot of information from
the git-annex branch should now be nearly as fast as before
the branch was introduced.

Before fsck was taking approximatly 3 hours, now it's running in 8 minutes.

The code is very nasty. It should be rewritten to read the header line
from git cat-file, and then read the specified number of bytes of content.
This commit is contained in:
Joey Hess 2011-06-29 21:23:40 -04:00
parent 8725fde5c6
commit e1c18ddec4
4 changed files with 54 additions and 36 deletions

View file

@ -7,11 +7,18 @@
module Types.BranchState where
import System.IO
data BranchState = BranchState {
branchUpdated :: Bool,
branchUpdated :: Bool, -- has the branch been updated this run?
-- (from, to) handles used to talk to a git-cat-file process
catFileHandles :: Maybe (Handle, Handle),
-- the content of one file is cached
cachedFile :: Maybe FilePath,
cachedContent :: String
}
startBranchState :: BranchState
startBranchState = BranchState False Nothing ""
startBranchState = BranchState False Nothing Nothing ""