Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dlocate where available, instead of dpkg search #1578

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Jul 23, 2023

The dpkg -S call is really slow, taking some 500ms per call.

$ time dpkg -S /usr/bin/podman
podman: /usr/bin/podman

real	0m0,583s
user	0m0,481s
sys	0m0,100s

Using dlocate -F is better, still not fast but tolerable (grep)

$ time dlocate -F /usr/bin/podman
podman: /usr/bin/podman
podman: /usr/bin/podman-remote

real	0m0,099s
user	0m0,072s
sys	0m0,034s

This a problem for podman version and info, which calls PackageVersion a lot (more than 10 times)

When using a database, like rpm, there is no particular overhead. But when using files: 5 seconds

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@Luap99 PTAL

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund, Luap99, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 4144457 into containers:main Jul 24, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants