drop performance improvements

Sped up seeking files to drop by 2x, and also some performance
improvements to checking numcopies.

Interestingly, the seek speedup is not due to precaching, but I think is
due to calling getParsed earlier.

Annex.Drop had to be changed to check inAnnex there, since it was removed
from Command.Drop. All other users of Command.Drop already checked inAnnex
themselves.

This commit was sponsored by Ryan Newton on Patreon.
This commit is contained in:
Joey Hess 2020-07-24 13:27:30 -04:00
parent a01aa214be
commit 18f1fb5841
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 40 additions and 37 deletions

View file

@ -17,6 +17,7 @@ import qualified Command.Drop
import Command
import Annex.Wanted
import Annex.SpecialRemote.Config
import Annex.Content
import qualified Database.Keys
import Git.FilePath
@ -118,7 +119,8 @@ handleDropsFrom locs rs reason fromhere key afile preverified runner = do
)
dropl fs n = checkdrop fs n Nothing $ \numcopies ->
Command.Drop.startLocal afile ai numcopies key preverified
stopUnless (inAnnex key) $
Command.Drop.startLocal afile ai numcopies key preverified
dropr fs r n = checkdrop fs n (Just $ Remote.uuid r) $ \numcopies ->
Command.Drop.startRemote afile ai numcopies key r