Skip to content

Add a dev server startup benchmark - #18005

Draft
matthewp wants to merge 3 commits into
mainfrom
perf/dev-startup-benchmark
Draft

matthewp wants to merge 3 commits into
mainfrom
perf/dev-startup-benchmark

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Adds a dev-startup benchmark that measures the span from spawning astro dev until the server prints its ready message, plus time to first response, on a small fixture with a content config.
  • Runs both as a standalone astro-benchmark dev-startup command and as a CodSpeed vitest bench, closing the coverage gap codspeed-hq flagged on Speed up dev server startup by deferring server app and content config compilation #17955.
  • Spawns with --port 0 and fully tears down each server (SIGTERM → SIGKILL, lock file removal), so parallel CI shards and repeated runs never collide.

Testing

  • New make-project/dev-startup.js, bench/dev-startup.js, and bench/dev-startup.bench.js cover both metrics.
  • Validated against Speed up dev server startup by deferring server app and content config compilation #17955's branch: time to ready drops from ~850–930 ms to ~550–570 ms (~35–40%); time to first response is flat, as expected — the PR defers the app compile past "ready", so the ready bench deliberately skips the first request to keep that signal.

Docs

  • No docs update needed — benchmark tooling only, no user-facing change.

Measures the span from spawning `astro dev` until the server prints its
ready message (plus time to first response), on a small fixture project with
a content config. Runs as both a standalone `astro-benchmark dev-startup`
command and a CodSpeed vitest bench (dev-startup.bench.js), so future
startup changes are tracked in the continuous benchmark suite.
@changeset-bot

changeset-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ba7c25c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 20 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing perf/dev-startup-benchmark (ba7c25c) with main (590df61)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

  2. No successful run was found on main (c2e6b0d) during the generation of this report, so 590df61 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

matthewp and others added 2 commits September 15, 2026 09:42
Fixes the eslint `regexp/no-unused-capturing-group` error flagged by the
Lint CI job.

This branch has not been deployed

No deployments
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