speedup filter(name=XXX, version=YYY, release=ZZZ, arch__neq=WWW)

the second most demanding filter
it is called 8297 times and gets 189s out of 15min run which is 21%
spent here

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Michael Mraka 2015-09-17 09:53:02 +02:00 committed by Lubomír Sedlář
parent d8fcaf95f7
commit ec56ee75e2
1 changed files with 5 additions and 1 deletions

View File

@ -653,6 +653,9 @@ class Gather(GatherBase):
if not self.opts.multilib_methods or self.opts.multilib_methods == ["none"]:
return added
q_multilib_binary_packages_cache = cache_init(self.q_multilib_binary_packages,
'name', 'version', 'release', arch__neq="noarch")
for pkg in sorted(self.result_binary_packages):
try:
self.finished_add_multilib_packages[pkg]
@ -666,7 +669,8 @@ class Gather(GatherBase):
self.finished_add_multilib_packages[pkg] = None
continue
pkgs = self.q_multilib_binary_packages.filter(name=pkg.name, version=pkg.version, release=pkg.release, arch__neq="noarch").apply()
pkgs = cache_get(q_multilib_binary_packages_cache,
pkg.name, pkg.version, pkg.release)
pkgs = self._get_best_package(pkgs)
multilib_pkgs = []
for i in pkgs: