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

Update to go1.22; speed up recursiveScan #402

Closed
wants to merge 5 commits into from

Conversation

egibs
Copy link
Member

@egibs egibs commented Aug 14, 2024

With Go 1.23.0 being released, I figured it was time for us to update bincapz to 1.22. This PR handles the Go update along with package updates, including clog which requires Go 1.22.

I also updated the slogtest.TestContextWithLogger calls to slogtest.Context in samples_test.go.

Additionally, I add some concurrency to recursiveScan which makes quite a big impact when scanning numerous directories/files:

main:

goos: linux
goarch: amd64
pkg: github.com/chainguard-dev/bincapz/samples
cpu: AMD Ryzen 7 7840U w/ Radeon 780M Graphics
BenchmarkRun-16 1 83237798093 ns/op 761214920 B/op 4789175 allocs/op
PASS
ok github.com/chainguard-dev/bincapz/samples 83.323s

New code:

goos: linux
goarch: amd64
pkg: github.com/chainguard-dev/bincapz/samples
cpu: AMD Ryzen 7 7840U w/ Radeon 780M Graphics
BenchmarkRun-16 1 50308758726 ns/op 762749936 B/op 4789434 allocs/op
PASS
ok github.com/chainguard-dev/bincapz/samples 50.402s

We're still hitting single-threaded bottlenecks during certain portions of the code execution so I'm tracking those down.

@egibs egibs marked this pull request as ready for review August 14, 2024 01:41
@egibs egibs requested review from tstromberg and hectorj2f August 14, 2024 01:43
@egibs
Copy link
Member Author

egibs commented Aug 14, 2024

I may tweak the concurrency a bit tomorrow.

@egibs egibs marked this pull request as draft August 14, 2024 02:00
@hectorj2f
Copy link
Member

Let's use go1.23 which is already available!

@egibs
Copy link
Member Author

egibs commented Aug 14, 2024

I'm going to break this PR apart -- one for the updates and another for performance/feature work.

@egibs egibs closed this Aug 14, 2024
@egibs egibs deleted the update-go-1.22 branch August 15, 2024 13:00
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