Create MaterializedPackageSets in threads to make pkgset faster.
When modules are used, there are lot of small package sets. These package sets have usually less than 500 packages. The createrepo part of `MaterializedPackageSet.create` executed for such small set of packages takes around 1 second. Most of this time the createrepo_c runs in single thread. It does the initialization, it writes the XML files, ... The parts of createrepo which can be run in parallel and therefore would use all the CPUs are quite small for very small package sets. This commit therefore executes multiple threads with `MaterializedPackageSet.create` for these very small package sets. This saves around 40 seconds from pkgset phase for RHEL compose. Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
parent
9391ce3065
commit
a209bda73c
3 changed files with 85 additions and 7 deletions
|
|
@ -17,6 +17,7 @@
|
|||
import os
|
||||
import json
|
||||
import re
|
||||
import functools
|
||||
from fnmatch import fnmatch
|
||||
from itertools import groupby
|
||||
|
||||
|
|
@ -723,15 +724,23 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
|
|||
# Optimization for case where we have just single compose
|
||||
# tag - we do not have to merge in this case...
|
||||
variant.pkgsets.add(compose_tag)
|
||||
pkgsets.append(
|
||||
MaterializedPackageSet.create(
|
||||
compose, pkgset, path_prefix, mmd=tag_to_mmd.get(pkgset.name)
|
||||
),
|
||||
)
|
||||
|
||||
pkgset.write_reuse_file(compose, include_packages=modular_packages)
|
||||
pkgsets.append(pkgset)
|
||||
|
||||
return pkgsets
|
||||
# Create MaterializedPackageSets.
|
||||
partials = []
|
||||
for pkgset in pkgsets:
|
||||
partials.append(
|
||||
functools.partial(
|
||||
MaterializedPackageSet.create,
|
||||
compose,
|
||||
pkgset,
|
||||
path_prefix,
|
||||
mmd=tag_to_mmd.get(pkgset.name),
|
||||
)
|
||||
)
|
||||
return MaterializedPackageSet.create_many(partials)
|
||||
|
||||
|
||||
def get_koji_event_info(compose, koji_wrapper):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue