docs: v1.20.0 release prep - DeepCopy documentation and corpus benchmark build tags#106
Merged
docs: v1.20.0 release prep - DeepCopy documentation and corpus benchmark build tags#106
Conversation
- 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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
Contributor
There was a problem hiding this comment.
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 corpustags 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+ |
7df3121 to
298bd11
Compare
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>
298bd11 to
6673fb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
//go:build corpustag to prevent memory exhaustionChanges
DeepCopy Documentation
Example_deepCopy()demonstrating how to use DeepCopy for independent document copiesBenchmarkDeepCopy()covering OAS2 and OAS3 documents at various sizesbenchmarks.mdwith DeepCopy performance metricsBenchmark Results
benchmarks/benchmark-v1.20.0.txtwith complete benchmark resultsbenchmarks.mdshowing significant improvements:Corpus Benchmark Build Tags
corpus_bench_test.gofiles in parser, validator, differ, fixer packages//go:build corpustag to exclude corpus benchmarks from regular runsbench-corpustarget to use-tags=corpusbench-releasetarget (no longer needs-skipflag)scripts/backfill-benchmarks.shThis prevents accidental memory exhaustion when running
go test -bench=.Test plan
make checkpasses (2263 tests)-tags=corpusmake bench-corpusor-tags=corpus🤖 Generated with Claude Code