speed up keys database writes
There seems to be no reason to check the time here. I think it was inherited from code in Database.Fsck, which does have a reason to commit every few minutes. Removing that syscall speeds up a git-annex init in a repo with 100000 annexed files by about 3 seconds. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
0f54e5e0ae
commit
eb6f6ff9b8
4 changed files with 26 additions and 8 deletions
|
@ -88,7 +88,9 @@ addDb :: FsckHandle -> Key -> IO ()
|
|||
addDb (FsckHandle h _) k = H.queueDb h checkcommit $
|
||||
void $ insertUnique $ Fscked k
|
||||
where
|
||||
-- commit queue after 1000 files or 5 minutes, whichever comes first
|
||||
-- Commit queue after 1000 changes or 5 minutes, whichever comes first.
|
||||
-- The time based commit allows for an incremental fsck to be
|
||||
-- interrupted and not lose much work.
|
||||
checkcommit sz lastcommittime
|
||||
| sz > 1000 = return True
|
||||
| otherwise = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue