As we iterate through Launchpad's source_package_publication_history
records, we keep looking up their distro_series objects via
GitUbuntuSourcePackageInformation.distribution.name and suchlike. This
results in a very large number of API calls to fetch the same
distro_series object from Launchpad every time, causing a severe
degradation in performance.
Since distribution_link is the same every time, we can instead key a
cache on this, eliminating the excessive number of API calls. The same
applies to some other similar calls.
As far as I can tell we've always made this excessive number of calls
here, but in practice something recently changed in the amount of time
these calls are taking, causing import performance to drop virtually to
a standstill. This optimisation restores reasonable performance again.
This introduces a new dependency on cachetools, which seems to be the
cleanest caching solution without having to reimplement it inside
git-ubuntu. python3-cachetools is available in Xenial and the module
seems to be stable upstream, so I hope this addition will not cause us
too much trouble.
Author: Karl Stenerud <email address hidden>
Date: Thu Mar 29 10:09:05 2019 +0100
Changed --deconstruct to --split
"deconstruct" was being confused as the opposite of "reconstruct",
even though they are different things. "split" makes for an
easier to remember mnemonic.
If we change directory to the location of the gitubuntu Python module
first, the commands to pylint and pytest are simpler and additionally
has the advantage that the output from pytest is nicer.