-
Notifications
You must be signed in to change notification settings - Fork 209
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 list instead of dpkg query #1923
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
/approve |
Converting the text files to a database would gain another 10x speedup, at the cost of generating the dbm (~10 seconds) Currently the main issue is the disk size (100M), which can be brought down to 10M with adding some new compression None of this would be needed for (or implemented in) podman... But it would bring down the deb times, to be more similar to rpm? For fun, I made just such a program: https://github.com/afbjorklund/debfile It brings the query time down from 1 second, to 5 milliseconds (200x speedup) Maybe if it gets popular, it could be used as well. But dlocate seems orphaned? https://tracker.debian.org/pkg/dlocate (last modified in 1.08 : Sun, 26 Dec 2021) |
Previously dlocate was only used for half of the process, not both. Use the dlocatedb for both lookups, both package list and file list. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
79dd76c
to
4c3011c
Compare
Once the move from podman to common is complete, it could do with some refactoring. The special cases for dpkg/dlocate, and for pacman/apk, could be moved into functions? |
If there were any unit tests, they would look for cases similar to these two: $ dpkg-query -W podman
podman 100:3.4.2-5
$ dpkg-query -W -f '${Package}_${Version}:${Architecture}\n' podman
podman_100:3.4.2-5:amd64 $ dlocate -l '^..\spodman\s'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-==============================================
ii podman 100:3.4.2-5:am Manage pods, containers and container images.
$ COLUMNS=160 dlocate -l '^..\spodman\s'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================================-==================================-======================================================================================
ii podman 100:3.4.2-5:amd64 Manage pods, containers and container images. |
@giuseppe PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afbjorklund, giuseppe, rhatdan 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 |
/lgtm |
Previously dlocate was only used for half of the process, not both.
It is better to use dlocate for both lookups, and avoid dpkg here.
Also makes results consistent, as the dlocatedb is updated daily.
This speeds up the execution time by 10x, when dlocate is installed.
It makes podman info takes 5-10 seconds, because it queries so many...
Podman info has become slower again, when running on ubuntu or debian podman#22102
podman --remote version takes 5 seconds on ubuntu podman#19317