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

Don't call build.New for index SBOM #851

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

jonjohnsonjr
Copy link
Contributor

We need to call a few methods that happen to hang off of build.Context, but they don't actually depend on the dirfs that build.New generates, which is expensive if we've written a large number of files to disk.

This skips that entirely and uses build.NewOptions to get the data we need to generate the index SBOM.

@jonjohnsonjr jonjohnsonjr requested a review from a team as a code owner August 18, 2023 19:59
@jonjohnsonjr jonjohnsonjr requested review from kaniini and removed request for a team August 18, 2023 19:59
We need to call a few methods that happen to hang off of build.Context,
but they don't actually depend on the dirfs that build.New generates,
which is expensive if we've written a large number of files to disk.

This skips that entirely and uses build.NewOptions to get the data we
need to generate the index SBOM.

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
@jonjohnsonjr
Copy link
Contributor Author

Before:

apko publish --arch amd64 --keyring-append  --repository-append     8.38s user 1.58s system 200% cpu 4.964 total```

After:

apko publish --arch amd64 --keyring-append  --repository-append     8.28s user 1.55s system 203% cpu 4.832 total

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

Nice.

@jonjohnsonjr jonjohnsonjr merged commit bf500a0 into chainguard-dev:main Aug 22, 2023
19 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.

2 participants