Files
@ 6fb68819e58e
Branch filter:
Location: kallithea/scripts/make-release
6fb68819e58e
2.0 KiB
text/plain
git: improve performance working with git changesets
GitRepository._repo instantiates a new dulwich.repo.Repo on every usage,
rather than once at initialization time of GitRepository. As this involves a
lot of filesystem access, this is a costly operation.
Instead, let GitRepository.__init__ instantiate a dulwich.repo.Repo once,
and let GitRepository._repo just return it.
This improves performance significantly.
On test_graphmod_git, performance improves from 6.29 seconds median to 3.06
seconds median.
[Thomas De Schampheleire: extend improvement to _all_ usage of
GitRepository._repo instead of only some. To limit the delta, retain the
_repo property but simply return self.repo.]
GitRepository._repo instantiates a new dulwich.repo.Repo on every usage,
rather than once at initialization time of GitRepository. As this involves a
lot of filesystem access, this is a costly operation.
Instead, let GitRepository.__init__ instantiate a dulwich.repo.Repo once,
and let GitRepository._repo just return it.
This improves performance significantly.
On test_graphmod_git, performance improves from 6.29 seconds median to 3.06
seconds median.
[Thomas De Schampheleire: extend improvement to _all_ usage of
GitRepository._repo instead of only some. To limit the delta, retain the
_repo property but simply return self.repo.]