Skip to content

Land benchmarks, faster rendering, site and README; adopt swift-llm-check 0.5.0 - #35

Merged
mackoj merged 9 commits into
mainfrom
chore/land-benchmarks-site-readme
Nov 14, 2026
Merged

mackoj merged 9 commits into
mainfrom
chore/land-benchmarks-site-readme

Conversation

@mackoj

@mackoj mackoj commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Why

#32, #33 and #34 were stacked on each other's branches and each was merged into its parent branch, not main. main (9ba4469) has only #31 (architecture rules and CI), so 1.0.6, tagged from main, has none of the benchmarks, rendering speedups, site or README work. Everything from those PRs is on docs/readme-and-metadata. This PR merges that branch into main (it merged cleanly, and the result is identical to the branch), then adds two small commits.

What's in it

  • Add benchmarks and render Package.swift 5x faster #32: Benchmarks and faster rendering. A Benchmarks/ package (package-benchmark) with a profiling script, docs/performance.md, and the rendering changes it measured. The rendered Package.swift is byte-for-byte the same.
  • Add a GitHub Pages landing page #33: GitHub Pages site. site/index.html and .github/workflows/pages.yml.
  • Refresh the README #34: README refresh.
  • Install snippets point at 1.0.6 in the README and on the site. They said 1.0.5.
  • swift-llm-check 0.5.0 for Architecture/ (test-only, not shipped):
    • xcTestImports and disabledTests now come from the library. The local copies and their detector tests are deleted.
    • .llm-check.yaml no longer excludes the Shared link folders. With symbolicLinks: follow, SourceFile.symbolicLinkDestination does the job of the hand-written SharedSource file-system walk.
    • Rule ids, titles and rationales are unchanged, so docs/architecture-rules.md is unchanged too.

Package.swift still pins package-generator-cli 0.7.0 (URL and checksum unchanged from main). CLI release 0.7.1 has no artifact bundle attached, so there is nothing newer to point at yet.

Performance

Rendering a 1,000-target Package.swift on Apple silicon, release build, p50, before → after (from docs/performance.md):

Benchmark Wall clock p50 (µs) Mallocs p50
Render Package.swift, 1,000 targets 42,598 → 8,552 (0.20x) 154,605 → 35,631 (0.23x)
Render Package.swift, 1,000 targets, default settings 38,273 → 8,372 (0.22x) 147,124 → 35,537 (0.24x)
Dependency graph, 1,000 targets 1,213 → 834 (0.69x) 5,003 → 29 (0.01x)
Decode config, Filter imports, Render products unchanged (code untouched; ±15 % run-to-run noise) unchanged

Verified locally

  • swift build --build-tests && swift test: 27 tests pass.
  • swift test --package-path Architecture: 15 tests pass. As a check, I replaced one benchmark Shared link with a copy, and test-sources-link-the-plugin-files failed on it.
  • swift build --package-path Benchmarks builds.

After merge

Cut the release so the perf work ships:

gh release create 1.0.7 --target main --title 1.0.7 --notes "Renders Package.swift about 5x faster with 4x fewer allocations on a 1,000-target package (output byte-for-byte unchanged). Adds a Benchmarks package, a GitHub Pages site and a refreshed README. These changes were meant for 1.0.6 but were merged into stacked branches instead of main."

Once this is merged, these branches can be deleted: chore/architecture-rules, perf/benchmarks, docs/github-pages, docs/readme-and-metadata.

Move renderSingleTarget, generateTargetsSection and the dependency graph
metrics into PackagePlugin-free files that report warnings through a
closure, and add renderPackageContent for the whole generated text. The
tests now link them and cover the rendered file byte for byte. Output is
unchanged.
A separate Benchmarks/ package links the plugin's PackagePlugin-free files
and measures config decoding, import filtering, the dependency graph and
rendering on a synthetic 1,000-target project. Includes the p50 and
hotspots tools and scripts/profile.sh. CI builds the benchmarks.
Compute each target's pragma-mark group once instead of in the sort
comparator, build the Apple SDK set once instead of per target, and count
local dependencies without building arrays. Output is byte for byte the
same. Document the benchmarks and results in docs/performance.md.
site/index.html explains the plugin and its companion CLI, with a real
config, the output it produces, and the install snippet for 1.0.5.
.github/workflows/pages.yml deploys site/ from main.
Add badges and links to the website, the CLI, performance and architecture
rules docs; state the requirements; install from 1.0.5; fix the leaf info,
pragma mark and unresolved-import examples to match the real output;
replace the stale Yams troubleshooting tip; add a Development section.
- `xcTestImports` and `disabledTests` come from the library; the local copies and
  their detector tests are gone.
- `.llm-check.yaml` no longer excludes the `Shared` folders: with `symbolicLinks:
  follow` the codebase reads the links and `SourceFile.symbolicLinkDestination`
  says where each points, which replaces `SharedSource` and
  `Detect.unlinkedTestSources`. The benchmarks' own code stays excluded.
- `SourceFile` is not a `Finding`, so the link rule maps each offending file to a
  `Violation` instead of calling `expectAll` on the files.

Rule ids, titles and rationales are unchanged, so docs/architecture-rules.md is too.
@mackoj
mackoj merged commit 825efad into main Nov 14, 2026
1 check passed
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