Skip to content

feat(reader): remove ParseNode infrastructure#2852

Draft
baywet wants to merge 5 commits into
mainfrom
chore/refactor-no-parse-node
Draft

feat(reader): remove ParseNode infrastructure#2852
baywet wants to merge 5 commits into
mainfrom
chore/refactor-no-parse-node

Conversation

@baywet
Copy link
Copy Markdown
Member

@baywet baywet commented May 25, 2026

Summary

  • remove the ParseNode wrapper infrastructure from reader parsing
  • parse directly with System.Text.Json JsonNode/JsonObject APIs and explicit ParsingContext propagation
  • prune unused JsonNode helper methods
  • refresh benchmark report artifacts

Benchmark Comparison vs Vincent Biret's Last Update (eb1258a)

Hardware difference:

  • Vincent's run: Intel i7-1185G7 3.00GHz (x64), .NET SDK 8.0.418, .NET 8.0.24 runtime
  • Current run: Snapdragon X 12-core X1E80100 3.40 GHz (ARM64), .NET SDK 10.0.300, .NET 8.0.27 runtime

Results comparison (Vincent → Current):

Benchmark Time Change Memory Change
PetStoreYaml 405.2 μs → 276.3 μs (32% faster) 361.39 KB → 305.91 KB (15% less)
PetStoreJson 173.0 μs → 112.8 μs (35% faster) 223.53 KB → 168.05 KB (25% less)
GHESYaml 951,103.8 μs → 608,668.3 μs (36% faster) 345343.16 KB → 250121.85 KB (28% less)
GHESJson 435,425.1 μs → 244,147.6 μs (44% faster) 206865.71 KB → 107293.42 KB (48% less)

Gen0/Gen1 GC collections: Similar or slightly lower across all benchmarks.

Key takeaway: The refactored code shows significant improvements in both execution time (30-45% faster) and memory allocation (15-50% less). However, note this is not an apples-to-apples comparison due to different hardware (ARM vs x64) and runtime versions. For a true performance assessment, you'd need to rerun Vincent's baseline commit on the same Snapdragon X hardware.

Validation

  • dotnet build Microsoft.OpenApi.slnx --no-restore --verbosity minimal
  • dotnet test Microsoft.OpenApi.slnx --no-build --verbosity minimal
  • dotnet run -c Release (from performance\benchmark)

baywet and others added 4 commits May 26, 2026 12:02
Refactor OpenAPI parsing to use System.Text.Json JsonNode APIs directly with explicit ParsingContext propagation, replacing the ParseNode wrapper hierarchy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@baywet baywet force-pushed the chore/refactor-no-parse-node branch from 6526d29 to a2858a9 Compare May 26, 2026 16:14
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
79.8% Coverage on New Code (required ≥ 80%)
43.5% Duplication on New Code (required ≤ 3%)
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant