perf(client): expose Prisma Client performance branch
Summary
Draft status PR for the Prisma repo side of the ongoing Prisma Client performance work. This branch contains the ClientEngine/runtime, generated exact/prepared helper, benchmark harness, and persistent performance-report changes that pair with the sibling engines branch.
This is intentionally not merge-ready as a final review unit. The branch is currently large (749 commits ahead, 1 commit behind fresh main) because it accumulated accepted experiments, rejected-experiment records, benchmark probes, and runtime changes during the investigation. I am opening it now so CI and reviewers can see the real state, then the next packaging step should be slicing it into smaller stacked PRs if this is too much to review at once.
Sibling engines PR: https://github.com/prisma/prisma-engines/pull/5820
Extracted engines child PRs:
- https://github.com/prisma/prisma-engines/pull/5821
- https://github.com/prisma/prisma-engines/pull/5822
Current split plan in this branch: wip/client-performance-pr-stack.md.
Linked Engines Branch for CI
The Prisma workflow reads this command from the PR body and builds native engines plus Wasm packages from the sibling engines branch:
/engine-branch prisma-client-performance-2026-06-08-engines
This intentionally blocks merge until the command is removed and tests are rerun with default engines. The sibling engines PR uses /prisma-branch prisma-client-performance-2026-06-08.
Main Contents
- Query-plan cache and compact lockstep internal plan consumption.
- ClientEngine/runtime support for raw-nested relation ops and final-owner schedule markers.
- Generated exact descriptor helpers and generated prepared cache-hit helpers for strict internal shapes.
- Edge/Workerd call-surface and plain-delegate improvements for extension-free generated clients.
- Focused Node and Miniflare/workerd performance probes.
- Persistent journal and intermediate performance report under
wip/.
Current Performance Readout
The rollup lives in wip/client-performance-intermediate-report.md.
Headline current state:
- Warmed query-plan cache vs recompilation:
findUnique752.61 -> 16.49 us/op, nested blog-page3122.43 -> 37.16 us/op. - Plan-cache memory: blog-page retained heap about
18.75 MiB -> 4.48 MiB, about76%lower; serialized retained plan JSON about9.45 MiB -> 3.33 MiB, about65%lower. - By-author blog-feed warmed generated path: generated default / request-precomputed / exact-helper
21.97 / 20.35 / 16.58 us/op -> 10.17 / 10.62 / 9.31 us/op; direct plan13.70 -> 6.95 us/op. - Generated prepared by-author feed: around
7.82-8.06 us/opon Node versus recent exact-helper9.20, and6.70 us/opon Workerd versus exact-helper8.10. - Flat string
findFirstgenerated prepared helper: Node generated prepared1.39 us/opversus default / exact-helper2.49 / 2.37; Workerd request loop1.45 us/opversus default / exact-helper2.95 / 1.90.
The branch has strong partial wins, but it has not proven a uniform 3x improvement across every generated-client steady-state scenario yet. The strongest remaining leads are expanded generated prepared/exact cache-hit coverage, a static/generated final-owner schedule executor, JS-owned cache-hit/query-input architecture, and profile-backed Rust graph/translation ownership work.
Validation Already Run Locally
Latest harness-restart checkpoint:
pnpm --filter @prisma/client-generator-ts test buildExactDescriptorMatcherRegistry.test.ts: passed, 17 tests.pnpm --filter @prisma/client-generator-js test buildExactDescriptorMatcherRegistry.test.ts: passed, 17 tests.pnpm --filter @prisma/client-generator-ts build: passed outside sandbox for knowntsxIPC restrictions.pnpm --filter @prisma/client-generator-js build: passed outside sandbox for knowntsxIPC restrictions.
Other accepted slices were validated with focused runtime tests, interpreter tests, local @prisma/client builds, Node timing probes, Miniflare/workerd timing and memory probes, and git diff --check.
Proposed Review Split
If this draft PR is too large as expected, split into a stack roughly like:
- Benchmark harness, persistent report, and cache/memory measurement infrastructure.
- Compact query-plan cache/runtime consumption and query-plan executor compatibility.
- Raw-nested runtime execution, relation ops, and final-owner schedule marker consumption.
- Generated exact descriptor helpers and generated prepared cache-hit helpers.
- Edge/Workerd call-surface improvements.
Internal data structures in this stack are version-lockstep. Internal format changes should replace producers and consumers together, without old/new compatibility branches unless a real external persistence or cross-version boundary exists.
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID:
e37697d6-a2df-4dcb-9344-774528315c9dYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Commit unit tests in branch
prisma-client-performance-2026-06-08
✨ Simplify code
- [ ] Create PR with simplified code
- [ ] Commit simplified code in branch
prisma-client-performance-2026-06-08
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 @coderabbitai help to get the list of available commands.
🔴 CUSTOM ENGINE IS USED This PR is using custom engine:
Branch: prisma-client-performance-2026-06-08-engines
Commit: 29000399a8a03aea36bbb263e0ddd46d10f24be9.
Don't forget to remove /engine-branch command from PR body and re-run the tests with default engine before merging.