Skip to content

cpe: unbind fs optimizations - #1979

Open
hdonnay wants to merge 6 commits into
quay:mainfrom
hdonnay:hack/cpe/unbindfs
Open

cpe: unbind fs optimizations#1979
hdonnay wants to merge 6 commits into
quay:mainfrom
hdonnay:hack/cpe/unbindfs

Conversation

@hdonnay

@hdonnay hdonnay commented Aug 10, 2026

Copy link
Copy Markdown
Member

Some memory profiling revealed that in large imports, this function is doing a lot of allocation just to do the unbinding (meaning the underlying cpe.WFN value is not in that bookkeeping).

These changes include:

  • some cleanup
  • benchmarking
  • a new, generated parser
  • switching to the new parser

The results locally:

goos: linux
goarch: amd64
pkg: github.com/quay/claircore/toolkit/types/cpe
cpu: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
BenchmarkUnbindFS/Simple-16         	 1978447	       655.0 ns/op	      32 B/op	       3 allocs/op
BenchmarkUnbindFS/Escape-16         	 1889960	       641.0 ns/op	      24 B/op	       2 allocs/op
BenchmarkUnmarshalFS/Simple-16      	 3437407	       361.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkUnmarshalFS/Escape-16      	 2744743	       455.2 ns/op	      16 B/op	       1 allocs/op
PASS
ok  	github.com/quay/claircore/toolkit/types/cpe	6.532s

@hdonnay
hdonnay requested review from a team as code owners August 10, 2026 21:42
@hdonnay
hdonnay requested a review from crozzy August 10, 2026 21:42
@hdonnay
hdonnay force-pushed the hack/cpe/unbindfs branch from ce58963 to df33810 Compare August 13, 2026 20:21
@hdonnay hdonnay added this to the Performance milestone Aug 17, 2026
@hdonnay
hdonnay force-pushed the hack/cpe/unbindfs branch 4 times, most recently from f359a6e to 33843a1 Compare August 20, 2026 18:36
Comment thread toolkit/types/cpe/unbind.go Outdated
@hdonnay
hdonnay force-pushed the hack/cpe/unbindfs branch from 33843a1 to 0dfe744 Compare August 21, 2026 21:35
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: Ie370751f04dea27303130efdecfaecb56a6a6964
This eliminates a slice allocation by inlining the "splitting" logic
into the only place it's used.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I535c589ce0ec716b6edce53b0678477d6a6a6964
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I5bf3f39e2302db5684d90903ffb645186a6a6964
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I089646b3afc8638fc305ddc0441078d06a6a6964
@hdonnay
hdonnay force-pushed the hack/cpe/unbindfs branch from 0dfe744 to 2858ac4 Compare August 21, 2026 21:52
This reimplements `UnbindFS` with `UnmarshalFS`, then removes the
dedicated benchmark and marks the former as deprecated.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I7d463973d062f4b352a3487372dadb036a6a6964
@hdonnay
hdonnay force-pushed the hack/cpe/unbindfs branch from 2858ac4 to 6d83d52 Compare August 24, 2026 21:13
@hdonnay
hdonnay requested a review from alkmim August 24, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants