Sped up query commands that read the git-annex branch by around 5%
authorJoey Hess <joeyh@joeyh.name>
Thu, 9 Apr 2020 17:54:43 +0000 (13:54 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 9 Apr 2020 17:54:43 +0000 (13:54 -0400)
commitaeca7c2207a652c8a72f044204a5c0edb4782aac
tree32a9c78654bf145e4cd89762e73eadf29f6a639f
parentaba905152af7937678b9e9ef0cdd5f70288dcdcd
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.
14 files changed:
Annex/Branch.hs
Annex/BranchState.hs
Assistant.hs
Benchmark.hs
CHANGELOG
CmdLine/Batch.hs
Command/Forget.hs
Command/Merge.hs
Command/TransferKeys.hs
Logs/Web.hs
RemoteDaemon/Core.hs
Types/BranchState.hs
Upgrade/V2.hs
doc/todo/optimise_journal_access.mdwn