Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Use sha1 from header if it exists #78

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

jonjohnsonjr
Copy link
Contributor

These headers would have been set by upstream in APKs. If they are present, just use them rather than creating temporary files and recomputing the sha1 for every file.

This cuts out ~25% of the work that installAPKfiles is doing and a couple seconds off the overall latency.

Before:

apko publish --keyring-append  --repository-append  --arch amd64    13.74s user 5.02s system 215% cpu 8.721 total
image image

After:

apko publish --keyring-append  --repository-append  --arch amd64    12.61s user 3.45s system 238% cpu 6.746 total
image image

@jonjohnsonjr
Copy link
Contributor Author

With checksum confirmation:

apko publish --keyring-append  --repository-append  --arch amd64    13.45s user 3.81s system 225% cpu 7.655 total
image image

These headers would have been set by upstream in APKs. If they are
present, just use them rather than creating temporary files and
recomputing the sha1 for every file.

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
@jonjohnsonjr jonjohnsonjr merged commit 3c93c31 into chainguard-dev:main Jul 8, 2023
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants