From bdba2c5914b38f9b116940424336a1ba7a8abd18 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Apr 2021 16:48:24 -0400 Subject: [PATCH] fastDebug Annex.Branch reads and writes Reads of cached data are not debugged, only cache misses are, and since many commands pre-cache location log data, this avoids a slew of fastDebug calls when running commands such as git-annex get --from --- Annex/Branch.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 96e693576a..a187832542 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -264,7 +264,9 @@ get file = getCache file >>= \case - (Changing the value this returns, and then merging is always the - same as using get, and then changing its value.) -} getLocal :: RawFilePath -> Annex L.ByteString -getLocal file = go =<< getJournalFileStale file +getLocal file = do + fastDebug "Annex.Branch" ("read " ++ fromRawFilePath file) + go =<< getJournalFileStale file where go (Just journalcontent) = return journalcontent go Nothing = getRef fullname file @@ -312,6 +314,7 @@ set :: Journalable content => JournalLocked -> RawFilePath -> content -> Annex ( set jl f c = do journalChanged setJournalFile jl f c + fastDebug "Annex.Branch" ("set " ++ fromRawFilePath f) -- Could cache the new content, but it would involve -- evaluating a Journalable Builder twice, which is not very -- efficient. Instead, assume that it's not common to need to read