Sped up the initial scanning for annexed files by 15%

Avoids database querying overhead when the database is newly created.

In the large repository where git-annex init took 24 seconds, this sped it
up to 20.47 seconds, a speedup of around 15%.

Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
Joey Hess 2022-11-18 13:16:57 -04:00
parent a3e9a0ae27
commit 8fcee4ac9d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 32 additions and 8 deletions

View file

@ -12,4 +12,6 @@ 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.
"""]]