Skip to content

pkg/distroidparser: cache parsed distro IDs - #2810

Merged
achilleas-k merged 1 commit into
osbuild:mainfrom
lfauster:distro-id-parse-cache
Nov 9, 2026
Merged

achilleas-k merged 1 commit into
osbuild:mainfrom
lfauster:distro-id-parse-cache

Conversation

@lfauster

@lfauster lfauster commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Sorting and repository lookups parse the same distro strings repeatedly, and each parse reloads the distro YAML. Cache each result on the parser and reuse DefaultParser while sorting.

In a local run, this reduces the runtime of the unit tests by about 6 minutes, which should help to keep it under the 20-minute CI test timeout, which currently is being reached quite often leading to pipeline failures.

It also reduces runtime of image-builder list --filter=distro:centos-9 from ~5.6s to ~3s.

Sorting and repository lookups parse the same distro strings repeatedly,
and each parse reloads the distro YAML. Cache each result on the parser
and reuse DefaultParser while sorting.

In a local run, this reduces the runtime of the unit tests by about 6 minutes,
which should help to keep it under the 20-minute CI test timeout, which
currently is being reached quite often leading to pipeline failures.

It also reduces `image-builder list --filter=distro:centos-9` from ~5.6s
to ~3s.
@lfauster
lfauster force-pushed the distro-id-parse-cache branch from e32e899 to af66900 Compare November 2, 2026 11:11
@lfauster
lfauster marked this pull request as ready for review November 2, 2026 14:29
@lfauster
lfauster requested a review from a team as a code owner November 2, 2026 14:29

@brlane-rht brlane-rht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice. Thank you!!

@achilleas-k
achilleas-k added this pull request to the merge queue Nov 9, 2026
Merged via the queue into osbuild:main with commit 207db4a Nov 9, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants