Skip to content

test(bench): add synthetic workerd app workloads - #900

Merged
domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:codex/synthetic-ssr-workloads
Aug 28, 2026
Merged

domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:codex/synthetic-ssr-workloads

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add two original synthetic SSR workloads in real workerd: a provider-heavy workspace bootstrap and a structured record/history page with nested streaming boundaries.
  • Measure first body byte, first primary content, stream completion, wire size, backend work and cache hits separately.
  • Benchmark/test tooling only: no runtime, compiler, adapter or published-package behavior changes; no changeset required.

Why

The existing fetch-pattern controls isolate small promise and data-loading shapes. These fixtures add larger component trees, consumed contexts, repeated data consumers, response-derived dependencies and nested boundaries so future framework changes can be evaluated against complete application-shaped output.

Changes

  • Workspace: six context providers, 48 navigation links, 18 rich tiles and seven unique data sources.
  • History: six context providers, 40 structured rows, nested author boundaries, six related items and nine unique data sources.
  • Four controls per workload: zero artificial delay, delayed data, bootstrap-blocked TTFB, and explicitly primed warm-data cache. Tree size is configurable independently of the number of backend resources.
  • Request-local promise deduplication and a bounded, tenant/size-keyed cache of completed JSON values. A local service-binding Worker generates all payloads.
  • Output/dependency oracles, deterministic shell/content release gates, concurrent tenant isolation, changed-size cache checks and 17 oracle tests. Add all-case smoke to the weekly/manual Bench workflow.
  • Document repeated-run results and their noise. Raw local samples remain ignored; the committed baseline note identifies commands, environment and limitations.

Validation

  • pnpm sync (with pnpm_config_verify_deps_before_run=warn to avoid automatic installation in the partially linked local environment); no generated tracked changes.
  • node --test benchmarks/ssr-workerd/app-workloads/verify.test.mjs scripts/ci-workflow.test.mjs — 78 tests passed.
  • BENCH_ROUNDS=1 node benchmarks/ssr-workerd/app-workloads/run.mjs 1 — all eight cases and streaming/cache/isolation preflights passed.
  • Two complete same-input runs plus a scale-4 run, each with three rounds of seven samples per case — 504 measured responses passed their complete-output and request-graph checks.
  • Scoped benchmark tsrx-tsc --noEmit and Prettier checks passed. Local validation used cached TSRX checker/formatter 0.3.120 because the locked 0.3.126 validation tools were unavailable; TypeScript 5.9.3 and Prettier 3.9.6. Performance builds used the exact TSRX core 0.1.61, Vite 8.1.5, Miniflare 4.20260714.0 and workerd 1.20260714.1 with this worktree's framework source.
  • git diff --check.
  • pnpm format:check — full-repository local command not run; scoped alternative above.
  • pnpm typecheck — full-repository local command not run; scoped alternative above.
  • pnpm test — full-repository local command not run; targeted tests above. Current-head remote CI will be checked after the draft-to-ready transition.

Risk / follow-ups

  • All fixture names, schemas, content, counts and schedules are invented. No proprietary application source, traces, endpoints, credentials, payloads or production measurements were used. These are synthetic workload candidates, not calibrated replicas of a private application.
  • This measures Octane SSR in local workerd, not the app-core/Cloudflare-adapter wrapper, deployed-edge latency, browser adoption, hydration or paint. Wire-payload completeness is not a reconstructed final-DOM assertion.
  • Same-code timing variance was too high for a 20% improvement/regression claim. No performance gain or absolute timing CI threshold is asserted; controlled paired measurements are required for future optimization claims.
  • Diagnostic routes and backend gates are local harness code, not production endpoints. The weekly Bench smoke checks correctness, not timing thresholds.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Changes are confined to benchmarks, CI smoke, and documentation; no production packages or SSR runtime behavior are modified.

Overview
Adds a standalone benchmarks/ssr-workerd/app-workloads harness that runs production-compiled Octane SSR in real workerd (Miniflare) against a local service-binding JSON backend—benchmark-only; no framework runtime or adapter changes.

Two invented workspace and history page shapes stress deep provider trees, nested @try streaming boundaries, request-scoped load() deduplication, and response-derived fetch chains. Each scenario runs four controls (zero-delay, delayed io, shell-less io-blocked-root, and explicitly primed warm-data), with optional BENCH_SCALE / delay tuning.

The runner records TTFB, first primary content, stream completion, wire size, and backend/cache stats, then enforces correctness via wire-payload oracles, shell/tail release gates, tenant isolation checks, and dependency-graph assertions (plus ~17 oracle unit tests). Docs include run instructions, a local baseline note (no CI timing thresholds), and ssr-workerd package scripts.

The weekly Bench workflow gains a step that runs the oracle tests and a one-round smoke of all eight cases; this suite stays outside the unified bench.mjs --ratios gate.

Reviewed by Cursor Bugbot for commit c9eefa1. Bugbot is set up for automated code reviews on this repo. Configure here.

Current-head CI

All 26 jobs in CI run 33219726137 passed for c9eefa1aad4f5777d304cf0b29742377c2c6ef4f, including lint, typecheck, all test/parity shards, package validation, examples, browser/website integration, and CI provenance. Cursor Bugbot completed successfully with no findings or review threads. Final pnpm sync left the worktree clean; the head contains the live main base. The PR is ready for human review, not auto-approved or merged.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent test PR: tests only labels Aug 28, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review August 28, 2026 23:14
@domgan-oai
domgan-oai merged commit bea2cd3 into octanejs:main Aug 28, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent test PR: tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant