How to speed up next.js 14 app router app in dev mode.
Answered
Philippine Crocodile posted this in #help-forum
Philippine CrocodileOP
I'm experiencing a significant difference in performance between my Next.js app on Vercel (fast) and local development (slow). The app runs much smoother in production but feels sluggish in local dev mode, including hot reloading.
Could you suggest ways to speed up local development?
I'm using Next.js 14.1.4
Could you suggest ways to speed up local development?
I'm using Next.js 14.1.4
Answered by B33fb0n3
you can use [turbo](https://nextjs.org/docs/app/api-reference/next-config-js/turbo) to speed up your local env in dev
23 Replies
@Philippine Crocodile I'm experiencing a significant difference in performance between my Next.js app on Vercel (fast) and local development (slow). The app runs much smoother in production but feels sluggish in local dev mode, including hot reloading.
Could you suggest ways to speed up local development?
I'm using Next.js 14.1.4
you can use [turbo](https://nextjs.org/docs/app/api-reference/next-config-js/turbo) to speed up your local env in dev
Answer
Philippine CrocodileOP
Thanks will setup it
happy to help
Philippine CrocodileOP
As I can see there they have not mentioned which configuration is need to boost your app.
Do you have any configuration, which is required?
Do you have any configuration, which is required?
I have add this
"dev": "next dev --turbo" script in package.jsonbut no improvements
@Philippine Crocodile by slowness what did you mean? when you navigate pages?
@B33fb0n3 you can use [turbo](https://nextjs.org/docs/app/api-reference/next-config-js/turbo) to speed up your local env in dev
Woodwasp
also I experienced slow redirects in client side using useRouter from next/navigation.
Is Turbo doing something about this?
Is Turbo doing something about this?
@Woodwasp instead of npm run dev, try
npm run build & npm run startand see if it's still slow
caches are not there in dev mode
@James4u caches are not there in dev mode
Woodwasp
wait a second
@James4u <@661056064606961713> by slowness what did you mean? when you navigate pages?
Philippine CrocodileOP
yes, when navigating page it is taking time to compile.
npm run build & npm run starttry to run production build on your local
Philippine CrocodileOP
Sure will try this
@James4u `npm run build & npm run start`
Asian black bear
This isn't really relevant here since it doesn't allow dev features and hot reloading. And yes, the local development server is much slower which is to be expected since files get compiled on the fly compared to a prebuilt production build.
@James4u `npm run build & npm run start`
Philippine CrocodileOP
Improved speed now
@Asian black bear This isn't really relevant here since it doesn't allow dev features and hot reloading. And yes, the local development server is much slower which is to be expected since files get compiled on the fly compared to a prebuilt production build.
I didn't mean hot reloading as OP said navigation is slow - wanted to see if it's expected behavior or not
@Philippine Crocodile Improved speed now
yeah, then it's expected @Philippine Crocodile Local server is slower than production build
Philippine CrocodileOP
Thanks for this information
I have deployed same app on vercel and azure web app but vercel app is faster than azure web app.
I have deployed same app on vercel and azure web app but vercel app is faster than azure web app.
@Philippine Crocodile Thanks for this information
I have deployed same app on vercel and azure web app but vercel app is faster than azure web app.
As said: for development use turbo of your need it faster in dev mode
Philippine CrocodileOP
I have used turbo in dev mode but no improvements