Significant slow performace (in dev) with create t3 app
I recently tried out the create t3 app. I am using neon, next-auth, prisma and app router. I did not change any of the initial code, only added some env. I deployed it to vercel, and simple posting and retrieving latest post will take at least 3-4 seconds. Any clarification on this will be much appreciated.
7 Replies
are you retrieving posts in dev or in prod. like where do you see these 3 - 4s loading times
in your title you have written "in dev"
however, later you say that you have deployed your project to vercel
sorry, it is from Production.
well then the delay is from vercel's serverless functions (lambda functions) warming up
after some googling it says that they need smwhere from a few 100ms - 3s to warm up
i would recommend you to enable fluide compute from your project's settings
theo did a really indepth video about fluide compute as well if you wanna check that out
https://www.youtube.com/watch?v=156FSMbyMPQ
Theo - t3․gg
YouTube
A cool new way to think about servers
Fluid compute is here! It's pretty good. There are catches though. Serverless has limitations, and I'm hyped that we're finally starting to move past them.
Thank you Blacksmith for sponsoring! Check them out at https://soydev.link/blacksmith
SOURCES
https://x.com/vercel/status/1886829534667735136
https://vercel.com/fluid
Check out my Twitch, ...
for reference fluid compute allows multiple requests to be handled at the same time, thus minimizing cold starts
Thanks for the effort and information. I've tried fluid compute and the project is still slow, cold start, take up to 7 seconds to login oauth, and take up to 3 seconds to create an entry (post) in neon.
I think it might be the way trpc is used in create t3 app (app router). Here is a conversation worth diving into. https://www.answeroverflow.com/m/1280560344116367412
Have you work on a project with create t3 app (app router) with trpc before? What platform did you deployed them.
Next 14 (app/router) is extremely slow (on dev) + tRPC + Turbopack ...
This is an issue we've been having in our App for a long time, and after months of suffering, I finally have the answers and the solutions, so I will provide bullet points here for anyone else who suffers with it now or in the future.
Problem:
Developing with Next 14 has became extremely slow when mixing up with tRPC.
The reason:
tRPC is...
for context
i mainly use nextjs (t3 stack) for my projects and it works perfectly fine (ignoring the cold starts on vercel).
i might deploy the project to railway if i don't want to bother with the cold starts
ill surely look into this thread
btw
can you check the regions of your serverless functions and neon db instance
ideally they should be in the same region
yeah
after watching the vid and reading the replies
it is how we use trpc that matters
really weird to think that this is only happening in prod as turbo pack is used in dev and webpack in prod (by default)
Yea. I think theo also mentioned that nextjs (without trpc) is faster than create t3 in his 1app5stack video. I think I am going to stick with nextjs server components for now.
Anyways, thanks for all the help man. Appreciate that.