Sped up query commands that read the git-annex branch by around 5%
The only price paid is one additional MVar read per write to the journal. Presumably writing a journal file dominiates over a MVar read time by several orders of magnitude. --batch does not get the speedup because then it needs to notice when another process has made a change. Also made the assistant and other damon modes bypass the optimisation, which would not help them anyway.
This commit is contained in:
parent
aba905152a
commit
aeca7c2207
14 changed files with 101 additions and 25 deletions
|
@ -14,6 +14,7 @@ import CmdLine.GitAnnex.Options
|
|||
import Options.Applicative
|
||||
import Limit
|
||||
import Types.FileMatcher
|
||||
import Annex.BranchState
|
||||
|
||||
data BatchMode = Batch BatchFormat | NoBatch
|
||||
|
||||
|
@ -72,7 +73,9 @@ batchInput fmt parser a = go =<< batchLines fmt
|
|||
parseerr s = giveup $ "Batch input parse failure: " ++ s
|
||||
|
||||
batchLines :: BatchFormat -> Annex [String]
|
||||
batchLines fmt = liftIO $ splitter <$> getContents
|
||||
batchLines fmt = do
|
||||
enableInteractiveJournalAccess
|
||||
liftIO $ splitter <$> getContents
|
||||
where
|
||||
splitter = case fmt of
|
||||
BatchLine -> lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue