Skip to content

docs: v1.20.0 release prep - DeepCopy documentation and corpus benchmark build tags#106

Merged
erraggy merged 3 commits intomainfrom
docs/deepcopy-release-prep
Dec 8, 2025
Merged

docs: v1.20.0 release prep - DeepCopy documentation and corpus benchmark build tags#106
erraggy merged 3 commits intomainfrom
docs/deepcopy-release-prep

Conversation

@erraggy
Copy link
Copy Markdown
Owner

@erraggy erraggy commented Dec 8, 2025

Summary

  • Add DeepCopy example and benchmarks to parser package documentation
  • Add v1.20.0 benchmark results
  • Make corpus benchmarks opt-in via //go:build corpus tag to prevent memory exhaustion

Changes

DeepCopy Documentation

  • Add Example_deepCopy() demonstrating how to use DeepCopy for independent document copies
  • Add BenchmarkDeepCopy() covering OAS2 and OAS3 documents at various sizes
  • Update benchmarks.md with DeepCopy performance metrics

Benchmark Results

  • Add benchmarks/benchmark-v1.20.0.txt with complete benchmark results
  • Update performance tables in benchmarks.md showing significant improvements:
    • FixParsed: 86μs → 2.3μs (~37x faster)
    • ConvertParsed: 16.2μs → 3.2μs (~5x faster)

Corpus Benchmark Build Tags

  • Create corpus_bench_test.go files in parser, validator, differ, fixer packages
  • Use //go:build corpus tag to exclude corpus benchmarks from regular runs
  • Update Makefile bench-corpus target to use -tags=corpus
  • Simplify bench-release target (no longer needs -skip flag)
  • Add documentation comment to scripts/backfill-benchmarks.sh

This prevents accidental memory exhaustion when running go test -bench=.

Test plan

  • make check passes (2263 tests)
  • Corpus benchmarks excluded without -tags=corpus
  • Corpus benchmarks run with make bench-corpus or -tags=corpus
  • DeepCopy example compiles and runs correctly

🤖 Generated with Claude Code

erraggy and others added 2 commits December 7, 2025 20:33
- Add Example_deepCopy to parser/example_test.go demonstrating document copying
- Add BenchmarkDeepCopy to parser/parser_bench_test.go for all document sizes
- Update benchmarks.md with DeepCopy Operations section showing ~30-100x faster
  performance vs JSON marshal/unmarshal approach
- Update fixer and converter performance metrics reflecting DeepCopy improvements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Includes all package benchmarks with new DeepCopy operations.
Key improvements from v1.19.1:
- Converter *Parsed operations: ~5x faster
- Overall converter: -53% time, -30% memory, -46% allocations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 8, 2025 05:11
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.08%. Comparing base (a1c3cee) to head (6673fb5).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   75.08%   75.08%           
=======================================
  Files          55       55           
  Lines       10040    10040           
=======================================
  Hits         7539     7539           
  Misses       1833     1833           
  Partials      668      668           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the v1.20.0 release by adding DeepCopy documentation/benchmarks and making corpus benchmarks opt-in via build tags to prevent memory exhaustion during regular benchmark runs.

Key Changes:

  • Adds DeepCopy example and benchmark demonstrating the new code-generated deep copy functionality
  • Introduces //go:build corpus tags to exclude resource-intensive corpus benchmarks from default runs
  • Documents significant performance improvements from DeepCopy optimization (FixParsed ~37x faster, ConvertParsed ~5x faster)

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
parser/parser_bench_test.go Adds BenchmarkDeepCopy for OAS2/OAS3 documents at various sizes
parser/example_test.go Adds Example_deepCopy demonstrating independent document copies
parser/corpus_bench_test.go New file with corpus benchmarks under //go:build corpus tag
parser/corpus_large_test.go Removes benchmark, adds migration comment pointing to corpus_bench_test.go
validator/corpus_bench_test.go New file consolidating corpus validation benchmarks with build tag
validator/corpus_integration_test.go Removes benchmark, adds migration comment
validator/corpus_large_test.go Removes benchmark, adds migration comment
fixer/corpus_bench_test.go New file with corpus fixer benchmark under build tag
fixer/fixer_test.go Removes benchmark, adds migration comment
differ/corpus_bench_test.go New file with corpus differ benchmark under build tag
differ/corpus_integration_test.go Removes benchmark, adds migration comment
Makefile Simplifies bench-release (removes -skip flag), updates bench-corpus to use -tags=corpus
scripts/backfill-benchmarks.sh Updates comment explaining corpus benchmarks require -tags=corpus in v1.20.0+
benchmarks/benchmark-v1.20.0.txt Adds complete v1.20.0 benchmark results including new DeepCopy benchmarks
benchmarks.md Documents DeepCopy performance, updates FixParsed/ConvertParsed improvements, increases benchmark count to 120+

Comment thread benchmarks.md Outdated
Comment thread benchmarks.md Outdated
Comment thread parser/parser_bench_test.go
Comment thread benchmarks.md Outdated
@erraggy erraggy force-pushed the docs/deepcopy-release-prep branch from 7df3121 to 298bd11 Compare December 8, 2025 05:19
Corpus benchmarks (BenchmarkCorpus_*) now require -tags=corpus to run.
This prevents accidental memory exhaustion when running `go test -bench=.`

Changes:
- Create corpus_bench_test.go files with //go:build corpus tag
- Move corpus benchmarks from original test files to tagged files
- Update Makefile bench-corpus target to use -tags=corpus
- Simplify bench-release target (no longer needs -skip flag)
- Update backfill-benchmarks.sh with documentation comment

Run corpus benchmarks with: make bench-corpus
Or directly: go test -tags=corpus -bench=BenchmarkCorpus ./...

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@erraggy erraggy force-pushed the docs/deepcopy-release-prep branch from 298bd11 to 6673fb5 Compare December 8, 2025 05:23
@erraggy erraggy merged commit 3109ef1 into main Dec 8, 2025
7 checks passed
@erraggy erraggy deleted the docs/deepcopy-release-prep branch December 8, 2025 05:24
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