Skip to content

Stop parsing entire XML BOM just to determine the schema version - #930

Merged
nscuro merged 1 commit into
CycloneDX:masterfrom
nscuro:xml-schema-version
Aug 24, 2026
Merged

Stop parsing entire XML BOM just to determine the schema version#930
nscuro merged 1 commit into
CycloneDX:masterfrom
nscuro:xml-schema-version

Conversation

@nscuro

@nscuro nscuro commented Aug 24, 2026

Copy link
Copy Markdown
Member

Determining the schema version previously involved parsing the full BOM, just to iterate over its XML namespaces. This caused XML parsing overhead and unnecessary memory usage.

This change switches the mechanism to streaming, making the procedure dirt-cheap, as it keeps only a small subset of data in-memory, and short-circuits when the desired information has been found.

Determining the schema version previously involved parsing the full BOM, just to iterate over its XML namespaces. This caused XML parsing overhead and unnecessary memory usage.

This change switches the mechanism to streaming, making the procedure dirt-cheap, as it keeps only a small subset of data in-memory, and short-circuits when the desired information has been found.

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro
nscuro requested a review from a team as a code owner August 24, 2026 15:37
@nscuro nscuro added the enhancement New feature or request label Aug 24, 2026
@codacy-production

codacy-production Bot commented Aug 24, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 84.62% diff coverage · -0.04% coverage variation

Metric Results
Coverage variation -0.04% coverage variation
Diff coverage 84.62% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (0b0d36f) 7843 5874 74.89%
Head commit (01b5963) 7833 (-10) 5863 (-11) 74.85% (-0.04%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#930) 26 22 84.62%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@nscuro
nscuro merged commit fa30309 into CycloneDX:master Aug 24, 2026
8 checks passed
@nscuro
nscuro deleted the xml-schema-version branch August 24, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant