-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Rebuild extremely slow #1980
Comments
+1 Rebuilds are extremely slow for me on OSX 10.11.6 |
+1 also quite slow on linux x64 after I moved my assets from the app folder to the appropriate assets folder, it now optimizes the assets folder every time I make a change to any of the code which seems to be the reason for the added delay. |
@TheLarkInn can you weigh in? It seems related with |
I also have a very slow "chunk assert optimization" step (~8s all the time even for small changes in one file). looking at webpack/webpack#539 (comment) it seems it could be due to the source-map configuration chosen. |
Would DLL loading for vendor items help here? They must be 90% of bundle size |
+1 build/rebuilds extremely slow, as well as the update/recompiling in the browser. |
+1, new to angular2. I really like how it was easy to get started, sadly, keeping going is much harder. Every time I modify a file and save, it takes more than 10 seconds before I can reload the browser and see my update. For web development, I can't do this. Maybe I'll switch to Angular2 JS. Here is what I see in my shell on ubuntu:
|
Same issue here. |
#2570 moved away from |
@asadsahi with
|
Allows for faster builds, partially addresses angular#1980
Allows for faster builds, partially addresses #1980
@filipesilva I also noticed rebuilds are about two times faster when I upgraded from beta.16 to beta.17; with average of 4 seconds. I'm still new to webpack world, so I don't yet really understand how things work internally, but after a quick search I found TypeStrong/ts-loader#78. Is this what's slowing down CLI's build process? I used custom gulp build process few months ago and had average 250ms rebuild times, so even 3-6 seconds with CLI is quite a setback ;( Also, bit off topic, is it possible to isolate app code from vendor code in dev builds? Would that speed things up? |
250ms would be like a dream! @filipesilva if I add all the ms in your run extract, we get: 3651ms total. There is still a 3 seconds missing right? When I run ng-serve, change some code, save my file, the change from "webpack: bundle is now VALID" to "webpack: bundle is now INVALID", takes a few second. Could this be optimized also? |
@sasxa we don't use @guiomie I am not too sure of how the numbers add up. All of that is handed over to webpack. I also asked @TheLarkInn and there seem to be some incoming Webpack 2 optimizations that would help with speed. |
@filipesilva yes I can confirm that rebuilds are somewhere taking same amount of time and I also suspect its somewhere in webpack because I am having similar rebuild times in another non-cli based project based on webpack 2. @sasxa webpack dll is for the purpose of separating vendor from application files for speeding up rebuilds. |
I see the similar issue and "ng serve" on any small sccs change reports these optimizations steps. It is very very slow. See the output:
ng version:
|
Ok, I could fix that (with the fix of beeman described in #4329). |
Great job! From 2s-4s time to 300-600ms |
Massive improvement for me on Windows 10 beta26: ~12s Thanks! |
While it's better with the new cli, here it is...
First run is with a single line change, the others are without any changes at all. With Anyway, we might be sort of a special case since we are loading most of RxJS, ThreeJS, Openlayers, D3, crypto-js, lodash, turf and a bunch more. |
Add `--no-sourcemap` option to `ng build/serve/test`. Disabling sourcemaps can help with build speeds. My tests on a medium project shoul a 11.5% improvement on initial builds, and a 37% improvement on rebuilds. Disabling sourcemaps will make debugging harder, since it makes line information very innacurate. Partially address angular#1980
Add `--vendor-chunk` option to `ng build/serve`. Enabling vendor chunk can help with rebuild speeds. My tests on a medium project show a 34% improvement on rebuild. This option is enabled by default on `ng serve` and `ng build`. To disable it, use `--no-vendor-chunk` flag. Partially address angular#1980 BREAKING CHANGE: `ng build/serve` now generates `vendor.bundle.js` by default.
Keep the TypeScript SourceFile around so we don't regenerate all of them when we rebuild the Program. The rebuild time is now 40-50% faster for hello world. This means all the files which haven't changed are not reparsed. Mentions: angular#1980, angular#4020, angular#3315
Hi, just wanted to say that I upgraded from beta 18 to 1.0.0 RC1, and the performance increase is spectacular, went from average rebuild of ~3-4 seconds to ~600ms-1000ms. I run "ng build --watch". Great job on getting this to an acceptable level. I've got an Asus Zenbook 12gb ram, SSD. |
I would also be remiss without giving serious kudos to the team. I've been updating regularly over the last few months and the last few builds have shown a massive performance increase. Huge thanks all! |
Totally agree with John. Great work! Thanks.
…On Mon, Mar 6, 2017 at 1:52 AM, John Livingston ***@***.***> wrote:
I would also be remiss without giving serious kudos to the team. I've been
updating regularly over the last few months and the last few builds have
shown a massive performance increase. Huge thanks all!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1980 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AV1APdJ3JPHglkLsZZmR-FkicvzyjGTGks5ri2bJgaJpZM4J07P9>
.
--
Alban Xhaferllari
PHP Developer
User Team
|
We aim to please 😄 |
I'm seeing 40-60 second build times with rc4, thought this was normal... |
@hanvyj build or rebuild? Our build times are now at nearly two minutes. Rebuilds are at 3s for no changes up to 30s in some cases. Did some profiling and it is mostly the source maps which are insanely slow. Disable them and builds become way faster...while debugging becomes a nightmare. All in all, you are still quite lucky I think. If things get really bad, there is always the option of ejecting. We have been considering it for a while. |
@hanvyj What's your command line look like? |
I run it with an NPM command that calls "ng serve --aot=true --proxy-config proxy.conf.json":
I played with a project that split the vendor bundle into a separate webpack script that didn't watch for changes. (it's rarely changed), I think it was all dealing with webpack without the CLI though. Is something like that possible with the CLI (it adds so much functionality and ease of use I'd take it over a faster build and setting up webpack myself!) |
That explains it. AoT is extremely slow, too slow to be used while developing. |
Ah, so I should turn it off when developing. I guess I'd have to be careful to not cause any changes that would break an AoT production build. Gets it down to 36 seconds build time, 5 second rebuild time - which is great! I guess I'll have to be careful not to do anything that could break AoT though (interestingly, turning it off highlighted a few errors, a service not marked as @Injectable(), no idea how that worked with AoT on!). Seems my method of creating Modal dialogs is completely broken, but there's a guide here I'll give a good read: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#jit-dev-aot-prod |
I have hello world project created with then I run ng build. Then I change a line in hello world |
@cyberprodigy please open a separate issue including the information from the template so that we can fully assist you. Please also be sure that you are using the latest version (1.0.0 at this time). |
@cyberprodigy it takes like 1 second on my machine with latest cli. You may dont have the latest installed. |
I upgraded a project from v2.4.10([email protected]) to 4.0.0 ( "@angular/cli": "1.0.0") and unfortunately don't see much improvements here is stat from new cli:
and here is from old one:
|
@cyberprodigy - If you are running it locally for development purposes, you should be using "ng serve", not "ng build". |
I'm having the same issues. Build takes 30 seconds on average. I'm using Vagrant for development environment. I guess it could slow it down a bit, but I wouldn't expect this much. It seems that it is compiling all modules everytime (even those from /node_modules) and doing chunk asset optimizations (probably for all assets). Is it developed that way or I am missing something in my configuration? @angular/cli: 1.0.0 |
Ng serve watches for changes and rebuilds only the changed chunks automatically. Killing the process each time forces a full build. |
What @clydin said, basically. Build times will not improve much (although webpack itself is reporting improvements so we shall see); rebuilding time should be much faster. Keep your process running and you'll see improvements. Locking this conversation down. This issue has been resolved a long time ago. |
OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 10
Versions. Please run
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.11-webpack.8
node: 6.3.0
os: win32 x64
Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
app created with 1.0.0-beta.11-webpack.2 and later on upgraded to 1.0.0-beta.11-webpack.8 with appropriate changes.
The log given by the failure. Normally this include a stack trace and some
more information.
The slow behavious is observed when upgraded from 1.0.0-beta.11-webpack.2 to 1.0.0-beta.11-webpack.8
Mention any other details that might be useful.
Slow behavious reproduceable in following repo:
https://github.com/asadsahi/ng2fb-bootstrap
I have experience this on two operating systems, windows 7 and windows 10. Has anyone else experieced this? For me rebuilds are dramatically slow, taking roughly 7-8 seconds which on same machine with cli version webpack.2 was taking rougly 2-3 seconds.
The text was updated successfully, but these errors were encountered: