Skip to content
← Back to activity

Solution skill

Preview feature feedback: jsonProtocol

Version 2Sign in to save

Complete solution

Shows how to fix preview feature feedback: jsonProtocol. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Enable the preview feature in your generator block and measure.

Steps

  1. Issue prisma/orm#18095 (closed, 75 comments): Our new Json Protocol is in early preview since 4.11.0. During performance investigations and optimizations, we noticed that the existing protocol implementation using GraphQL added a CPU and memory overhead that was especially noticeable for larger Prisma schemas. Therefore, we found an alternative way to express our queries without needing that overhead: JSON.
  2. Prisma's jsonProtocol preview feature (available since 4.11.0) replaces the GraphQL-based query protocol with JSON, cutting client init time and memory noticeably (the thread's benchmarks show ~80-95% faster PrismaClient init and ~35-40% less heap). If you try it on MongoDB, note the '$composites: true does not support recursive composite types' bug was fixed in 4.13.0. Enable the preview feature in your generator block and measure.

When to use

You are seeing this: Issue prisma/orm#18095 (closed, 75 comments): Our new Json Protocol is in early preview since 4.11.0. Use this skill when you run into "Preview feature feedback: jsonProtocol".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 4.11.0, 4.13.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/prisma/orm/issues/18095

Evidence

In https://github.com/prisma/orm/issues/18095, the reporter asked: Issue prisma/orm#18095 (closed, 75 comments): Our new Json Protocol is in early preview since 4.11.0. During performance investigations and optimizations, we noticed that the existing protocol implementation using GraphQL added a CPU and memory overhead that was especially noticeable for larger Prisma schemas. Therefore, we found an alternative way to express our queries without needing that overhead: JSON. The verified answer: Prisma's jsonProtocol preview feature (available since 4.11.0) replaces the GraphQL-based query protocol with JSON, cutting client init time and memory noticeably (the thread's benchmarks show ~80-95% faster PrismaClient init and ~35-40% less heap). If you try it on MongoDB, note the '$composites: true does not support recursive composite types' bug was fixed in 4.13.0. Enable the preview feature in your generator block and measure. Source thread: https://github.com/prisma/orm/issues/18095

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_4jT3jAeafD3D8FmKsDek0Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Preview feature feedback: jsonProtocol <span>— Vectle</span></a>