Skip to content

Commit b092229

Browse files
committed
docs: add TODO for duplicate JSON parsing optimization
Documents the known performance consideration where bundle data is parsed twice (Detect + Store). Defers optimization to allow discussion of implementation approaches. Signed-off-by: Claude Code <noreply@anthropic.com> Signed-off-by: Cole Kennedy <cole@testifysec.com>
1 parent d2671b4 commit b092229

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • pkg/metadatastorage/format/sigstorebundle

pkg/metadatastorage/format/sigstorebundle/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func init() {
3434
}
3535

3636
// Detect returns true if obj is a valid Sigstore bundle
37+
// TODO(performance): This causes duplicate JSON parsing - IsBundleJSON parses to validate,
38+
// then Store() parses again. Consider memoization or cheap heuristic detection.
39+
// See PR discussion for implementation options and trade-offs.
3740
func (h *Handler) Detect(obj []byte) bool {
3841
return sigstorebundle.IsBundleJSON(obj)
3942
}

0 commit comments

Comments
 (0)