]> source.dussan.org Git - jgit.git/commit
Introduce core.trustPackedRefsStat config 26/197526/7
authorKaushik Lingarkar <quic_kaushikl@quicinc.com>
Fri, 2 Dec 2022 21:21:02 +0000 (13:21 -0800)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 5 Jan 2023 14:52:36 +0000 (15:52 +0100)
commit82b5aaf7e3e3f881056dd2d4486e02537b0493da
tree91ff2e5dd3d8bfe5ad054c1ddcf7ab58edf6822b
parent52aa9c81fcc72961d2ecb4ecadea6d869a6f878a
Introduce core.trustPackedRefsStat config

Currently, we always read packed-refs file when 'trustFolderStat'
is false. Introduce a new config 'trustPackedRefsStat' which takes
precedence over 'trustFolderStat' when reading packed refs. Possible
values for this new config are:

* always: Trust packed-refs file attributes
* after_open: Same as 'always', but refresh the file attributes of
              packed-refs before trusting it
* never: Always read the packed-refs file
* unset: Fallback to 'trustFolderStat' to determine if the file
  attributes of packed-refs can be trusted

Folks whose repositories are on NFS and have traditionally been
setting 'trustFolderStat=false' can now get some performance improvement
with 'trustPackedRefsStat=after_open' as it refreshes the file
attributes of packed-refs (at least on some NFS clients) before
considering it.

For example, consider a repository on NFS with ~500k packed-refs. Here
are some stats which illustrate the improvement with this new config
when reading packed refs on NFS:

trustFolderStat=true trustPackedRefsStat=unset: 0.2ms
trustFolderStat=false trustPackedRefsStat=unset: 155ms
trustFolderStat=false trustPackedRefsStat=after_open: 1.5ms

Change-Id: I00da88e4cceebbcf3475be0fc0011ff65767c111
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
Documentation/config-options.md
org.eclipse.jgit/.settings/.api_filters
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java