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

Verifying packages is slow #103

Closed
stevenh opened this issue May 2, 2023 · 3 comments · Fixed by #104
Closed

Verifying packages is slow #103

stevenh opened this issue May 2, 2023 · 3 comments · Fixed by #104
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@stevenh
Copy link
Contributor

stevenh commented May 2, 2023

We tried this action to improve our apt install performance in our workflows and once cached it was often actually slower than just performing the apt-get install.

I did a bit of digging and the main delay was "Verifying packages" process which is taking about 0.7s per package listed.

Testing locally apt-cache show ${package} is ~40ms where as on github is ~700ms.

Given this and the current flow we could be spending ~1.4s per package just calling apt-cache show.

stevenh added a commit to stevenh/cache-apt-pkgs-action that referenced this issue May 2, 2023
Use a single call to apt-cache to reduce the time needed to lookup
package versions.

Fixes awalsh128#103
stevenh added a commit to stevenh/cache-apt-pkgs-action that referenced this issue May 2, 2023
Use a single call to apt-cache to reduce the time needed to lookup
package versions.

Also:
* Added millisecond details to log timing so slow operations can be more
  easily identified.
* Perform apt update before determining package versions.

Fixes awalsh128#103
awalsh128 pushed a commit that referenced this issue Oct 11, 2023
* fix: apt cache performance

Use a single call to apt-cache to reduce the time needed to lookup
package versions.

Also:
* Added millisecond details to log timing so slow operations can be more
  easily identified.
* Perform apt update before determining package versions.

Fixes #103

* chore: descriptive variable names and use log_err

Added the review feedback, updating variable names to be more
descriptive and using log_err where appropriate.
@awalsh128 awalsh128 reopened this Oct 30, 2023
@awalsh128
Copy link
Owner

Re-opening as the fix introduced a regression break (see #104 (comment))

@awalsh128 awalsh128 added enhancement New feature or request help wanted Extra attention is needed labels Oct 30, 2023
@awalsh128
Copy link
Owner

I am in the process of moving the code to golang and started with this functionality.

#117

I'll close this out once a release is ready.

@awalsh128
Copy link
Owner

https://github.com/awalsh128/cache-apt-pkgs-action/releases/tag/v1.4.0 now has the Golang version of the querying component and the fix is incorporated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants