-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow compile speed #5934
Comments
For me a new create-nuxt-app builds in less then 9 seconds, can you share some more details and a reproduction maybe? |
My computer (laptop), where I measure speeds, has processor Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz with 12 GB RAM and nvme SSD. My operating system is Pop!_Os (it's a Debian distribution). I do the test with basic npx create command. I start with the command for Nuxt.js and for Next.js. Then I try to build both apps (NOT at once). The results are consistent that Nuxt.js is 2x slower than Next.js.
Please try to build both apps and then compare them. The differences in speed of small applications are same as of large applications. (Which makes the difference from seconds to minutes). |
I've looked at a lot of comments and found that a lot of people actually have this problem, but in fact so far there is no effective solution for the official, I hope to optimize, thank you
my build takes 5 minutes+,now |
Thanks for your contribution to Nuxt.js!
Issues that are labeled as |
A build taking so much time usually indicates either a really large application or problems in the underlying configuration/code base. However, we are trying to improve the build and HMR time as good as we can. But a large part of it comes through the user-added dependencies |
If it's so, why is it happening in the official Nuxt.js example? |
Thanks for your contribution to Nuxt.js!
Issues that are labeled as |
Large HTML Dokument > 1000 lines of markup, takes up to minutes compiling! So for large html dokuments nuxt is unusable at the moment. ℹ Preparing project for development 10:14:17 ✔ Client ℹ Waiting for file changes 10:16:33 |
@do-web do you have an example that would reproduce this example? Would be happy to dig in and see what is going on. |
Does anyone have a solution to the same problem ?, I only use an old notebook with specifications: CPU: Intel Atom N270 NodeJS: v12.11.0 in the fresh install of I know the problem is the limitations of the device I am using, but I hope I can get advice so that the process can run fast. Thank you. |
That does seem unnaturally slow. My best advice would be to try on another computer as you are most likely dealing with some sort of hardware issue. We used 2gb of ram with node 8.11.1 on digitalocean and was substantially faster for the built on production mode (which does minificiation and such). |
@padri-zan That CPU was already slow when it was new, let alone 11 years later. If the net/notebook has a hdd, try to see if you can use a ssd/sd card/usb as the cpu is probably also bogged with io-waits. Maybe even try to setup a ram-disk and copy your full project to it and then run it. Make the ram disk as small as possible, ~512MB should be enough hopefully depending on your project but note that ALL files on the ram-disk are lost when you unplug the power. So if you make changes on the ramdisk you have to manually copy them to the real disk as well. Use google to look for howto's of creating a ramdisk for your operating system. But the best advise is to try to upgrade to a somewhat quicker machine |
Yes, I think it is like that, I will try on some services such as Digitalocean, GCP, etc. |
Indeed, slow to compile on XPS 15 / Core i7, 12GB RAM: 20 seconds for relatively small website with about 20 pages. Nothing weird going on and no other packages than nuxt provides. Also seems to be slower while developing, until I get node crash due to running out of heap memory. Will keep a watch of things to see if I can improve reporting... |
same here, taking 15-20 seconds to compile |
This bug is closed? Why? Nuxt takes almost 20 minutes to build. A simple one line css change causes dev rebuild of 4 minutes each time. I use a brand new MacBook with 16gb memory. Not the MacBook. My app is relatively small too. I see Nuxt get hung up on string replace. This bug got closed for some reason even though it was not properly addressed. |
Still the same! |
For me the issue seems to not exist when I tell Nuxt to not use SSR... Try that maybe? |
Same problem here, and no @tvld I am using in SPA mode / Has anyone had much luck in speeding things up? |
Set ‘components’ to be ‘false’ in Nuxt confit and then it works fine for me.
…On Fri, 8 Jan 2021 at 7:30 AM, Jordan Dominguez ***@***.***> wrote:
Same problem here, and no @tvld <https://github.com/tvld> I am using in
SPA mode / ssr: false and same problems.
Has anyone had much luck in speeding things up?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5934 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKSJBH7R2CBWFLEKUANUG3LSYZRKPANCNFSM4HYIDHJQ>
.
|
@BR0008 what you mean with |
Yes, @tvld. It’s part of nuxt.config.js.
The property was ‘true’ by default and setting it to ‘false’, helped
resolve the unexpected build slow down.
The below is how the property look like:
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
…On Sat, 9 Jan 2021 at 3:38 PM, Tom ***@***.***> wrote:
@BR0008 <https://github.com/BR0008> what you mean with { components:
false } ? In what part of nuxt.config.js ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5934 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKSJBH4RPLQG7NZUEQMHOXDSZATKDANCNFSM4HYIDHJQ>
.
|
@BR0008 it says it is "false" by default; I never had a need to change that ... hmmm.. )) |
And I use Macbook Pro 16GB memory too.
|
Version
v2.8.1
Reproduction link
https://github.com/nuxt/create-nuxt-app
Steps to reproduce
yarn create nuxt-app
yarn run build
What is expected ?
Build takes about 12-15 seconds.
What is actually happening?
Build takes 25+ seconds.
Additional comments?
I am really strugling with build times. When I for example try Next.js compilation, it only takes 12 seconds (on the first and 5 seconds after each new build) for the template to compile. Nuxt.js on the other hand takes 25 seconds and more. It takes 2x longer. I dont like it, because deployment of simple two page app takes 4+ minutes on Now.sh. I think that these speeds should be way faster.
I have also one more complicated app and the build takes 10 minutes+. And that is awful.
I have seen some advices how to cache and parallel, but neither of these made significant speed up. (I cant use cache, because it is containerized).
Is there some work towards it or are there any options, how to improve it?
The text was updated successfully, but these errors were encountered: