use insert_ for speed improvement

persistent-2.14.4.1 makes insert_ faster than insert because it skips
getting the key back.

Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
Joey Hess 2022-12-26 15:18:55 -04:00
parent aa041596f5
commit cf892f4256
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 19 additions and 1 deletions

View file

@ -93,7 +93,7 @@ addAssociatedFile k f = queueDb $
-- any old key.
newAssociatedFile :: Key -> TopFilePath -> WriteHandle -> IO ()
newAssociatedFile k f = queueDb $
void $ insert $ Associated k af
insert_ $ Associated k af
where
af = SFilePath (getTopFilePath f)

View file

@ -0,0 +1,18 @@
[[!comment format=mdwn
username="joey"
subject="""comment 17"""
date="2022-12-26T19:10:04Z"
content="""
<https://github.com/yesodweb/persistent/issues/1441> got fixed in
persistent-2.14.4.1. git-annex will get that speed improvement when it's
built with that version. I'd anticipate it improving from 19 seconds
to around 16 seconds.
(I further opened <https://github.com/yesodweb/persistent/issues/1457>
that would speed up some other parts of git-annex if implemented.)
---
The only reason to leave this bug open is that reconcileStaged is still
somehow slower than only the persistent-sqlite overhead can explain.
"""]]