Post by account_disabled on Feb 24, 2024 21:25:06 GMT -6
The overhead especially for larger schemas. One of our solutions to alleviate this issue was a complete redesign of our wire protocol. Using JSON we were able to make communication between Prisma Client and the query engine significantly more efficient. We released this feature behind the jsonProtocol Preview feature flag in version 4.11.0. Before we began any work on performance improvements an average cold start request looked like this Before After enabling the jsonProtocol Preview feature the graph looked like this After After a lot of great feedback from our users and extensive testing were excited to announce that jsonProtocol is now Generally Available and is the default wire protocol that Prisma Client will use under the hood. If youre interested in further details we wrote an extensive.
Blog post that goes indepth into the changes we made to improve Prisma Clients startup performance How We Sped Up Serverless Cold Switzerland Mobile Number List Starts with Prisma by 9x. Smaller JavaScript runtime and optimized internals Besides changing our protocol we also made a lot of changes that impacted Prismas performance With the new JSONbased wire protocol becoming the default we took the opportunity to clean up Prisma Clients dependencies. This included cutting Prisma Clients dependencies in half and removing the previous GraphQ Llike protocol implementation. This reduced the execution.
Time and the amount of memory that Prisma Client used. We also optimized the internals of the query engine. Specifically the parts responsible for transforming the Prisma schema when the query engine is started and establishing the database connection. Also we now lazily generate types in the query schema which improves the memory usage of Prisma Client and leads to significant runtime performance improvements. In addition connection establishment and Prisma schema transformation now happen in parallel instead of running sequentially as they did before. Before we made these three changes the graph looked like this with the json Protocol Preview feature enabled Before After making these three changes the response time was cut by twothirds After The request.
Blog post that goes indepth into the changes we made to improve Prisma Clients startup performance How We Sped Up Serverless Cold Switzerland Mobile Number List Starts with Prisma by 9x. Smaller JavaScript runtime and optimized internals Besides changing our protocol we also made a lot of changes that impacted Prismas performance With the new JSONbased wire protocol becoming the default we took the opportunity to clean up Prisma Clients dependencies. This included cutting Prisma Clients dependencies in half and removing the previous GraphQ Llike protocol implementation. This reduced the execution.
Time and the amount of memory that Prisma Client used. We also optimized the internals of the query engine. Specifically the parts responsible for transforming the Prisma schema when the query engine is started and establishing the database connection. Also we now lazily generate types in the query schema which improves the memory usage of Prisma Client and leads to significant runtime performance improvements. In addition connection establishment and Prisma schema transformation now happen in parallel instead of running sequentially as they did before. Before we made these three changes the graph looked like this with the json Protocol Preview feature enabled Before After making these three changes the response time was cut by twothirds After The request.