:wave: I've seen a bunch of issues reference perfo...
# prisma-client
b
👋 I've seen a bunch of issues reference performance and latency. Just wanted to share what I've encountered and see what the best way to provide this feedback is. TL;DR enabling
napi
cut our p95 latency of a hot endpoint from ~800ms to around ~200ms.
We're going to add actual caching to speed this up even more but was really scratching my head as to why performance was so poor for what felt like relatively light queries. This seemed to be like a pretty easy fix 🤷
👍 3
💯 5
c
Can I ask what you’re doing for instrumentation? Is it just the code from the dd-trace-js issue?
b
Haha ya that's the exact issue. It has worked relatively well so far, I just wish I had better visibility into the actual sql and I'm still seeing random requests hanging for like ~2 seconds
I ended up re-writing a super hot part of the code directly in SQL, using the
mysql2
package.
It's not a one-to-one comparison but it seems to be much faster and even if it's not it's really helpful to see the actual breakdown.
c
Yeah for sure, the scheduler can often lead to locally-suboptimal timings here.