Add reproducible benchmark baselines and CI checks - #172
Open
ajevans99 wants to merge 10 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/ajevans99/swift-json-schema/sessions/4fc5caa7-b73d-469a-9323-5fcc24ef1438 Co-authored-by: ajevans99 <30383071+ajevans99@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ajevans99/swift-json-schema/sessions/4fc5caa7-b73d-469a-9323-5fcc24ef1438 Co-authored-by: ajevans99 <30383071+ajevans99@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ajevans99/swift-json-schema/sessions/4fc5caa7-b73d-469a-9323-5fcc24ef1438 Co-authored-by: ajevans99 <30383071+ajevans99@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ajevans99/swift-json-schema/sessions/4fc5caa7-b73d-469a-9323-5fcc24ef1438 Co-authored-by: ajevans99 <30383071+ajevans99@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ajevans99/swift-json-schema/sessions/4fc5caa7-b73d-469a-9323-5fcc24ef1438 Co-authored-by: ajevans99 <30383071+ajevans99@users.noreply.github.com>
Add checksum-pinned reference corpus fetching, bootstrap complete static thresholds, use loadable benchmark identifiers, and enforce thresholds through package-benchmark's supported check command. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
4 tasks
✅ No public API breaking changes introducedCompared this PR's head against This check shows only changes this PR introduces. Cumulative |
Commit the complete 66-file threshold set generated by the benchmark workflow on ubuntu-24.04 so subsequent runs enforce regression checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Report timing metrics without gating on noisy hosted-runner measurements, while retaining strict allocation threshold enforcement. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ajevans99
marked this pull request as ready for review
August 20, 2026 21:38
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reproducible OrderedJSON and JSONSchema benchmarks, pinned optional corpora, committed p90 baselines, and CI enforcement.
Changes:
- Adds schema construction, validation, output, and serialization workloads.
- Adds checksum-pinned corpus fetching and baseline coverage checks.
- Adds Ubuntu CI reporting, threshold checks, artifacts, and formatting coverage.
Reviewed changes
Copilot reviewed 83 out of 84 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Summary |
|---|---|
Makefile |
Formats benchmark sources. |
Benchmarks/Scripts/fetch-reference-corpus.sh |
Fetches checksum-pinned reference corpora. |
Benchmarks/Scripts/check-thresholds.sh |
Runs benchmark threshold checks. |
Benchmarks/Scripts/check-baseline-coverage.sh |
Moderate unresolved issue (3 votes): listing failures can be masked by process substitution, allowing incomplete baselines to pass. |
Benchmarks/README.md |
Documents benchmark usage and CI baselines. |
Benchmarks/Package.swift |
Adds the JSONSchema benchmark target. |
Benchmarks/Package.resolved |
Updates dependency resolution metadata. |
Benchmarks/OrderedJSONBenchmarks/OrderedJSONBenchmarks.swift |
Adds workloads, thresholds, and optional corpus loading. |
Benchmarks/JSONSchemaBenchmarks/Resources/poll.schema.json |
Adds Poll schema fixture. |
Benchmarks/JSONSchemaBenchmarks/Resources/poll.instance.json |
Adds Poll instance fixture. |
Benchmarks/JSONSchemaBenchmarks/Resources/openapi-fragment.schema.json |
Adds OpenAPI schema fixture. |
Benchmarks/JSONSchemaBenchmarks/Resources/openapi-fragment.instance.json |
Adds OpenAPI instance fixture. |
Benchmarks/JSONSchemaBenchmarks/Resources/draft2020-12-schema.schema.json |
Adds draft 2020-12 schema fixture. |
Benchmarks/JSONSchemaBenchmarks/Resources/draft2020-12-schema.instance.json |
Adds draft 2020-12 instance fixture. |
Benchmarks/JSONSchemaBenchmarks/JSONSchemaBenchmarks.swift |
Moderate unresolved issue (4 votes): unresolved meta-schema references make draft 2020-12 validation and output baselines measure invalid-reference short circuits. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.wide-object.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.wide-object.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.users-array.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.users-array.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.twitter.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.twitter.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.small.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.small.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.poll-instance.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.poll-instance.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.deep-array.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.deep-array.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.citm_catalog.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.citm_catalog.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.canada.OrderedJSON.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.serialize.canada.JSONEncoder.sortedKeys.p90.json |
Adds serialization p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.wide-object.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.users-array.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.twitter.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.small.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.poll-instance.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.deep-array.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.citm_catalog.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.roundtrip.canada.OrderedJSON.p90.json |
Adds round-trip p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.wide-object.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.wide-object.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.wide-object.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.users-array.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.users-array.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.users-array.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.twitter.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.twitter.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.twitter.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.small.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.small.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.small.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.poll-instance.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.poll-instance.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.poll-instance.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.deep-array.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.deep-array.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.deep-array.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.citm_catalog.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.citm_catalog.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.citm_catalog.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.canada.OrderedJSON.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.canada.JSONSerialization.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/OrderedJSONBenchmarks.parse.canada.JSONDecoder.p90.json |
Adds parsing p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.validate.poll.Schema.validate.p90.json |
Adds validation p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.validate.openapi-fragment.Schema.validate.p90.json |
Adds validation p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.validate.draft2020-12-schema.Schema.validate.p90.json |
Adds validation p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.poll.verbose.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.poll.flag.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.poll.detailed.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.poll.basic.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.openapi-fragment.verbose.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.openapi-fragment.flag.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.openapi-fragment.detailed.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.openapi-fragment.basic.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.draft2020-12-schema.verbose.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.draft2020-12-schema.flag.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.draft2020-12-schema.detailed.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.output.draft2020-12-schema.basic.p90.json |
Adds output p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.construct.poll.Schema.init.p90.json |
Adds construction p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.construct.openapi-fragment.Schema.init.p90.json |
Adds construction p90 baseline. |
Benchmarks/Baselines/JSONSchemaBenchmarks.construct.draft2020-12-schema.Schema.init.p90.json |
Adds construction p90 baseline. |
.gitignore |
Ignores benchmark artifacts and fetched corpora. |
.github/workflows/format.yml |
Extends formatting coverage. |
.github/workflows/benchmarks.yml |
Adds Ubuntu benchmark CI, reports, and artifacts. |
Suppressed comments (2)
Makefile:23
-not -pathonly filters which paths are printed;findstill descends intoBenchmarks/.build. After any benchmark build,make formattherefore scans the entire SwiftPM build/dependency tree on every invocation. Prune that directory with-path 'Benchmarks/.build' -prune -obefore the name filters.
Makefile:17-not -pathonly filters which paths are printed;findstill descends intoBenchmarks/.build. After any benchmark build,make formattherefore scans the entire SwiftPM build/dependency tree on every invocation. Prune that directory with-path 'Benchmarks/.build' -prune -obefore the name filters.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Load the draft 2020-12 meta-schema with its complete remote context, propagate benchmark listing failures, and prune generated trees during formatting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Record the expected allocation profile for full draft 2020-12 meta-schema validation under Swift 6.3.3 on x86_64 Ubuntu. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
Supersedes #171 with a clean implementation based on current
main.JSONSchemaBenchmarksfor schema construction, validation, and all four output levels across Poll, OpenAPI-fragment, and draft 2020-12 workloads.canada,citm_catalog, andtwitterreference corpus while preserving offline local benchmarks.thresholds checkoperation and handles SwiftPM's improvement marker without accepting regressions or other plugin failures.Timing calibration
Static wall-clock and CPU thresholds are informational on GitHub's shared hosted runners. Repeated runs of the same commit exceeded the initial 10% tolerance, with timing deviations reaching 73%, while allocation counts remained stable. CI therefore reports timing for trend analysis and gates malloc counts with the configured 10% relative plus 10-allocation absolute tolerance. Suspected timing regressions should be reproduced on a dedicated runner.
The final enforcement workflow passed three consecutive runs on
ubuntu-24.04(run32418739341, attempts 1-3), including both benchmark targets and the fetched reference corpus.Validation
swift testmake formatTracking