On Tue, Aug 15, 2017 at 8:15 AM, RjOllos <rjol...@gmail.com> wrote: > I've been wondering about the purpose of [git] persistent_cache and what the > trade-offs are with enabling it. I've looked through the code, but don't > have a clear idea yet. I'd like to improve the TracRepositoryAdmin > documentation for the [git] peristent_cache option and the cached > [repositories] section attribute (#12406). > > The tradeoffs for the cached attribute look straightforward to me. There is > more overhead in setting up explicit synchronization, but once properly > configured a cached repository is always preferred as it will offer better > performance. So the tradeoff is time to configure vs performance. > > Can anyone describe the purpose of persistent_cache and the trade-offs with > enabling it?
First, tracopt.versioncontrol.git.* constructs cache for all revisions, children of each revision, parents of each revision and all refs of target Git repository in-memory. Second, checking whether the cache is fresh is determined by whether any refs in cached refs are changed (using git show-ref). If cache is not fresh, it reconstructs cache. Enabling [git] persistent_cache, it checks whether it needs to refresh the cache when Repository.sync() is invoked via explicit synchronization. If explicit synchronization is not set up, new commits in the repository wouldn't be shown. Disabling [git] persistent_cache, it checks whether it needs to refresh the cache each web request. That is `git show-ref` command is invoked each web request. However, new commits in the repository would be shown even if no explicit synchronization. I consider persistent_cache option is not needed for per-repository. > Would it make sense to have persistent_cache as a per-repository attribute, > as in #12406? Similarly, should git_fs_encoding be a per-repository > attribute? The other [git] options appear they should be global rather than > per-repository, but I wonder about those two. I think it would be good to be able to use git_fs_encoding option for both global and per-repository. The encoding is typically utf-8 however Trac currently cannot handle if some repositories use non utf-8 encoding. -- Jun Omae <jun6...@gmail.com> (大前 潤) -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+unsubscr...@googlegroups.com. To post to this group, send email to trac-dev@googlegroups.com. Visit this group at https://groups.google.com/group/trac-dev. For more options, visit https://groups.google.com/d/optout.