use insert_ for speed improvement
authorJoey Hess <joeyh@joeyh.name>
Mon, 26 Dec 2022 19:18:55 +0000 (15:18 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 26 Dec 2022 19:59:41 +0000 (15:59 -0400)
persistent-2.14.4.1 makes insert_ faster than insert because it skips
getting the key back.

Sponsored-by: Dartmouth College's DANDI project
Database/Keys/SQL.hs
doc/bugs/performance_regression__63___init_takes_times_more/comment_17_d13e85f691165b533d6630a93111c786._comment [new file with mode: 0644]

index 77afb871a18691d3429cf7fa06c086fa3f16aa24..0ebeaf7f4fd3dc275c405fcaf1e5c1cba9d622c2 100644 (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)
 
diff --git a/doc/bugs/performance_regression__63___init_takes_times_more/comment_17_d13e85f691165b533d6630a93111c786._comment b/doc/bugs/performance_regression__63___init_takes_times_more/comment_17_d13e85f691165b533d6630a93111c786._comment
new file mode 100644 (file)
index 0000000..b3a3534
--- /dev/null
@@ -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.
+"""]]