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
|
@ -45,7 +45,7 @@ perform :: Transitions -> Bool -> CommandPerform
|
|||
perform ts True = do
|
||||
recordTransitions Branch.change ts
|
||||
-- get branch committed before contining with the transition
|
||||
Branch.update
|
||||
_ <- Branch.update
|
||||
void $ Branch.performTransitions ts True []
|
||||
next $ return True
|
||||
perform _ False = do
|
||||
|
|
|
@ -30,7 +30,7 @@ seek bs = do
|
|||
|
||||
mergeAnnexBranch :: CommandStart
|
||||
mergeAnnexBranch = starting "merge" (ActionItemOther (Just "git-annex")) $ do
|
||||
Annex.Branch.update
|
||||
_ <- Annex.Branch.update
|
||||
-- commit explicitly, in case no remote branches were merged
|
||||
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
||||
next $ return True
|
||||
|
|
|
@ -17,6 +17,7 @@ import qualified Remote
|
|||
import Utility.SimpleProtocol (dupIoHandles)
|
||||
import Git.Types (RemoteName)
|
||||
import qualified Database.Keys
|
||||
import Annex.BranchState
|
||||
|
||||
data TransferRequest = TransferRequest Direction Remote Key AssociatedFile
|
||||
|
||||
|
@ -29,6 +30,7 @@ seek = withNothing (commandAction start)
|
|||
|
||||
start :: CommandStart
|
||||
start = do
|
||||
enableInteractiveJournalAccess
|
||||
(readh, writeh) <- liftIO dupIoHandles
|
||||
runRequests readh writeh runner
|
||||
stop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue