Repository navigation
Conversation
Measure all four bundled template generation paths through the trusted template pipeline with a bounded, offline harness that performs no dependency install, Git initialization, or network access. It reports deterministic environment/artifact metadata plus wall-clock statistics (mean, median, p95, min, max, standard deviation, coefficient of variation) so repeated runs on the same platform can be compared for regressions. Timings are not asserted in CI; the suite verifies coverage of every path, offline generation without node_modules, and structural reproducibility.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
closes #211
Measure all four bundled template generation paths through the trusted template pipeline with a bounded, offline harness that performs no dependency install, Git initialization, or network access. It reports deterministic environment/artifact metadata plus wall-clock statistics (mean, median, p95, min, max, standard deviation, coefficient of variation) so repeated runs on the same platform can be compared for regressions. Timings are not asserted in CI; the suite verifies coverage of every path, offline generation without node_modules, and structural reproducibility.
Summary
Adds a bounded, local performance benchmark harness for the project generator. The harness measures all four bundled template generation paths (
basic-app,full-stack,smart-contract,api-service) through the same trusted template pipeline used bystellarforge new, and reports wall-clock statistics plus deterministic artifact measurements so repeated runs on the same platform can be compared for regressions.The harness performs no dependency installation, no Git initialization, and no network access, so its timings reflect local generator cost rather than registry or install latency. It is deterministic in structure (fixed iteration/warmup counts, canonical template ordering, stable artifact counts) while explicitly avoiding absolute-timing assertions so it stays reliable in CI.
Related Issue
Closes #211
Scope
Completed:
tests/helpers/generator-benchmark.ts— reusable harness core. Runs warmup plus bounded, timed iterations ofgenerateProjectFromTemplate(resolved viaresolveBundledTemplateRoot) into isolated temp directories, computes mean/median/p95/min/max/standard deviation/coefficient of variation, records generated file count and byte totals, and flags anynode_modulesoutput. Exposes deterministic fingerprint, JSON, and human-readable text serializers plus a bounded iteration resolver.tests/generator-benchmark.test.ts— Vitest suite (runs undernpm testand standalone): measures every bundled path offline; verifies each template's documented artifacts are generated with the substituted project name and nonode_modules; asserts structural reproducibility across two runs; and verifies iteration overrides are defaulted and clamped (bounded).tests/helpers/index.ts— re-exports the new benchmark helper.docs/contributing/testing.md— new "Performance Benchmarks" section documenting purpose, exclusions, how to run, the iteration override, and regression comparison.Intentionally left out:
package.json/.changesetchanges (protected surfaces not in scope; test-only work does not require a changeset).template-generation.ts,template-registry.ts,template-sources.ts,validation.ts); they are only imported.Testing
Harness runs offline against the bundled templates and is covered by the normal Vitest suite.
Commands run locally:
npm run typecheck— passednpm run lint— passednpm run build— passednode node_modules/vitest/vitest.mjs run tests/generator-benchmark.test.ts— 4/4 passedStandalone harness output (verbose reporter,
STELLARFORGE_BENCHMARK_ITERATIONS=5):Notes:
Generated file counts/bytes are stable across runs; median is the recommended comparable metric. Coefficients of variation reflect local Windows disk/AV variance and are reported, not asserted.
npm testlocally shows two unrelated, pre-existing failures (configuration.test.ts,template-generation.test.ts) caused byEPERMwhen creating symlinks on this Windows host. These fail identically on cleanmainand are unrelated to this change.npm run format:checkflags onlypackage.json, a pre-existing localcore.autocrlfworktree artifact (git ls-files --eolreportsi/lf w/crlf); git treats the file as unchanged. All changed files pass Prettier.Tests added/updated where applicable
Existing relevant tests pass
Lint/type/build checks pass where available
Security Impact
Security notes:
Release Impact
No published/user-visible behavior change
Patch
Minor
Breaking/pre-1.0 contract change
Changeset included where required
Changeset not required; reason explained below
Release notes:
Test-only and documentation changes. No shipped CLI behavior, command surface, template output, or package metadata is modified, so no changeset is required per
docs/contributing/changesets.md.Documentation
Updated
docs/contributing/testing.mdwith a Performance Benchmarks section describing the harness, its offline/DEP-free scope, how to run it, how to raise iterations, and how to use it for regression comparison.Checklist
docs/contributing/wave-architecture.mdfor Stellar Wave work