avoid uncessary keys db writes; doubled speed!
authorJoey Hess <joeyh@joeyh.name>
Wed, 12 Oct 2022 19:21:19 +0000 (15:21 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 12 Oct 2022 19:33:16 +0000 (15:33 -0400)
commit6fbd337e34cd62881ed5e21616e9c00d7bf35378
tree6501fa547d3a49195275ee43b7635c6f20225b9d
parentba7ecbc6a9c3763e8152e4f46522d14a4ee2b59d
avoid uncessary keys db writes; doubled speed!

When running eg git-annex get, for each file it has to read from and
write to the keys database. But it's reading exclusively from one table,
and writing to a different table. So, it is not necessary to flush the
write to the database before reading. This avoids writing the database
once per file, instead it will buffer 1000 changes before writing.

Benchmarking getting 1000 small files from a local origin,
git-annex get now takes 13.62s, down from 22.41s!
git-annex drop now takes 9.07s, down from 18.63s!
Wowowowowowowow!

(It would perhaps have been better if there were separate databases for
the two tables. At least it would have avoided this complexity. Ah well,
this is better than splitting the table in a annex.version upgrade.)

Sponsored-by: Dartmouth College's Datalad project
Annex/WorkTree.hs
CHANGELOG
Database/Keys.hs
Database/Keys/Handle.hs
Database/Keys/Tables.hs [new file with mode: 0644]
Upgrade/V7.hs
git-annex.cabal