trpc-openapi icon indicating copy to clipboard operation
trpc-openapi copied to clipboard

Performance is less than ideal, can't seem to figure out what causes it

Open alansikora opened this issue 2 years ago • 1 comments

image

3.8s was one of the fastest requests I had, locally, it usually takes 8 to 10 seconds

my request is defined as:

export const testRouter = router({
  auth: protectedApiProcedure
    .meta({ openapi: { method: "GET", path: "/test/auth" } })
    .input(z.void())
    .output(z.object({ status: z.string() }))
    .query(async () => {
      return {
        status: "ok",
      };
    }),
});

protectedApiProcedure is:

image

Any guesses on what could be causing this?

alansikora avatar Feb 27 '23 14:02 alansikora

are the underlying tRPC responses fast, and it's just trpc-openapi endpoints that are slow for you?

Prisma + serverless can be very slow due to cold starts in case that's applicable too

jamiew avatar Apr 14 '23 18:04 jamiew