From: Joey Hess Date: Fri, 18 Nov 2022 17:29:34 +0000 (-0400) Subject: queue more changes to keys db X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~60^2~166 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c834d2025a4a3defbd650c33feb1c81092ebdd90;p=git-annex.git queue more changes to keys db Increasing the size of the queue 10x makes git-annex init 7% faster in a repository with 86000 annexed files. The memory use goes up, from 70876 kb to 85376 kb. --- diff --git a/CHANGELOG b/CHANGELOG index eed419b50f..a8b06f1412 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ git-annex (10.20221105) UNRELEASED; urgency=medium * Support quettabyte and yottabyte. - * Sped up the initial scanning for annexed files by 15%. + * Sped up the initial scanning for annexed files by 21%. -- Joey Hess Fri, 18 Nov 2022 12:58:06 -0400 diff --git a/Database/Keys/SQL.hs b/Database/Keys/SQL.hs index 54e1a59bf7..77afb871a1 100644 --- a/Database/Keys/SQL.hs +++ b/Database/Keys/SQL.hs @@ -73,8 +73,8 @@ newtype WriteHandle = WriteHandle H.DbQueue queueDb :: SqlPersistM () -> WriteHandle -> IO () queueDb a (WriteHandle h) = H.queueDb h checkcommit a where - -- commit queue after 1000 changes - checkcommit sz _lastcommittime = pure (sz > 1000) + -- commit queue after 10000 changes + checkcommit sz _lastcommittime = pure (sz > 10000) -- Insert the associated file. -- When the file was associated with a different key before, diff --git a/doc/bugs/performance_regression__63___init_takes_times_more/comment_13_a79fcbe80060d11582989a9fc31d4a92._comment b/doc/bugs/performance_regression__63___init_takes_times_more/comment_13_a79fcbe80060d11582989a9fc31d4a92._comment index 02dac893e3..36474beabe 100644 --- a/doc/bugs/performance_regression__63___init_takes_times_more/comment_13_a79fcbe80060d11582989a9fc31d4a92._comment +++ b/doc/bugs/performance_regression__63___init_takes_times_more/comment_13_a79fcbe80060d11582989a9fc31d4a92._comment @@ -12,6 +12,4 @@ This will need some care to be implemented safely... I benchmarked it, and using insertUnique is no faster, but using insert is. This would be a 15% speed up. - -Update: Implemented this optimisation. """]] diff --git a/doc/bugs/performance_regression__63___init_takes_times_more/comment_14_8c3b13806adb731435b346a64990527b._comment b/doc/bugs/performance_regression__63___init_takes_times_more/comment_14_8c3b13806adb731435b346a64990527b._comment new file mode 100644 index 0000000000..8c6505d068 --- /dev/null +++ b/doc/bugs/performance_regression__63___init_takes_times_more/comment_14_8c3b13806adb731435b346a64990527b._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 14""" + date="2022-11-18T17:26:03Z" + content=""" +Implemented the two optimisations discussed above, and init in that +repository dropped from 24 seconds to 19 seconds, a 21% speedup. +"""]]