Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Watching is slow #47

Closed
Manduro opened this issue Sep 30, 2016 · 78 comments
Closed

Watching is slow #47

Manduro opened this issue Sep 30, 2016 · 78 comments
Assignees

Comments

@Manduro
Copy link
Contributor

Manduro commented Sep 30, 2016

Watching has slowed down a lot using the new npm scripts. Below are samples of the time watching takes. 29 seconds is a very long wait for livereloading. The gulp task took about 3 seconds. I'm hoping there's still a lot to improve here!

Are there some config settings we can override to improve speed, until the default situation improves?

Start watch: 46 seconds

[11:18:01]  ionic-app-scripts 0.0.23
[11:18:01]  watch started ...
[11:18:01]  build dev started ...
[11:18:01]  clean started ...
[11:18:01]  clean finished in 76 ms
[11:18:01]  copy started ...
[11:18:01]  typescript compiler started ...
[11:18:02]  lint started ...
[11:18:02]  copy finished in 459 ms
[11:18:19]  typescript compiler ready in 17.15 s
[11:18:19]  bundle dev started ...
[11:18:20]  lint finished in 18.64 s
[11:18:45]  bundle dev finished in 26.51 s
[11:18:45]  sass started ...
[11:18:48]  sass finished in 2.35 s
[11:18:48]  build dev finished in 46.11 s
[11:18:48]  watch ready in 46.33 s

Livereload: 29 seconds

[11:38:25]  typescript compilation started ...
[11:38:29]  typescript compilation finished in 4.58 s
[11:38:30]  bundle dev update started ...
JS changed:   www/build/main.js
JS changed:   www/build/main.js.map
[11:38:54]  bundle dev update finished in 23.23 s
[11:38:54]  sass started ...
[11:38:54]  sass finished in 211 ms
@mhartington
Copy link
Contributor

Please see #44

This should ease up the watches memory usage and speed it up a bit.

@Manduro
Copy link
Contributor Author

Manduro commented Sep 30, 2016

I'm not sure about that as it seems to fix the issue where multiple instances are running concurrently, but my watch is this slow even when I save a single change (thus only creating a single instance).

I'll be sure to report back when #44 is merged!

@mhartington
Copy link
Contributor

Closed via #44

This should be fixed in the next release of app scripts.

@Kobzol
Copy link

Kobzol commented Oct 2, 2016

Even with the above fix and ionic-app-scripts 0.0.27, it takes ~4 seconds for TS to compile in watch and ~8 seconds to bundle my project, in general it takes about ~15 seconds to reload. With the previous browserify + gulp build chain it took only 2 seconds. Is there any way to speed this up?

@Manduro
Copy link
Contributor Author

Manduro commented Oct 2, 2016

@mhartington Speed has definitely not changed with the new version. I'm still at 25-30 seconds for a watch reload and ~50 seconds for the initial build. Gulp did it in about 3 seconds for the same project.

@jaufgang
Copy link

jaufgang commented Oct 2, 2016

@mhartington, I agree with @Manduro and @Kobzol that this issue is not related to #44 and should be re-opened. The slowness does not seem to be related to a bug, but rather the bundling, AoT compilation and tree shaking performed by the introduction of Rollup. These steps slow down livereloading substantially. You are adding 15-30 seconds to the build time to shave less than a second off browser load time, and it doesn't make sense to do that for a build that is going to be loaded only once before being overwritten by the next small change.

I think the ideal solution would be to provide a "fast build" config option that skips these optimizations (AoT Compilation, tree shaking) and is tuned to provide the shortest wait between the start of the build and completion of the browser reload, and ionic serve should use that configuration. Hopefully that will bring us back to the super-fast reloads we were enjoying with previous beta releases.

@MarkChrisLevy
Copy link

MarkChrisLevy commented Oct 3, 2016

Hi, unfortunately I must confirm that this is a huge problem. In beta11, with no AoT and rollup live reload was working great, just few seconds and changes were compiled to the script. Now, with the application that contains lots of .ts files and dependencies it takes almost 40-50 seconds to build .js output file (about 10-15sec for typescript compilation and 30-40 sec for bundle).

@mhartington, @manucorporat please reopen.

@mhartington mhartington reopened this Oct 3, 2016
@MarkChrisLevy
Copy link

MarkChrisLevy commented Oct 3, 2016

@mhartington Thanks for reopen. Below some logs from npm run watch:

-- initial build --
[15:31:10] ionic-app-scripts 0.0.27
[15:31:10] watch started ...
[15:31:10] build dev started ...
[15:31:10] clean started ...
[15:31:11] clean finished in 473 ms
[15:31:11] copy started ...
[15:31:11] typescript compiler started ...
[15:31:11] lint started ...
[15:31:12] copy finished in 1.50 s
[15:31:14] lint finished in 2.87 s
[15:31:33] typescript compiler ready in 21.70 s
[15:31:33] bundle dev started ...
[15:31:58] bundle dev finished in 25.76 s
[15:31:58] sass started ...
[15:32:02] sass finished in 3.97 s
[15:32:02] build dev finished in 51.91 s
[15:32:02] watch ready in 52.11 s

-- after one letter change in .ts file --
[15:34:40] typescript compilation started ...
[15:34:55] typescript compilation finished in 14.31 s
[15:34:56] bundle dev update started ...
[15:35:12] bundle dev update finished in 16.06 s
[15:35:12] sass started ...
[15:35:12] sass finished in 28 ms

As you can see it takes about 30 seconds to build new main.js. It seems, that there is an issue with typescript 2.0, cause it shouldn't take 14 seconds to compile one changed file - I've reported that as well microsoft/TypeScript#10018 (comment). The other issue is rollup, which takes 16 seconds.

@maxkunitsa
Copy link

maxkunitsa commented Oct 3, 2016

I have same issues as described early by other colleagues. For example:

[20:13:47] typescript compilation started ...
[20:13:50] typescript compilation finished in 3.05 s
[20:13:50] bundle dev update started ...
JS changed: www/build/main.js
[20:14:03] bundle dev update finished in 12.72 s
[20:14:03] sass started ...
[20:14:03] sass finished in 53 ms

With beta.11 i had watch timing between 1-2.5 s.

@adamdbradley adamdbradley self-assigned this Oct 3, 2016
@jaufgang
Copy link

jaufgang commented Oct 4, 2016

I would like to point out that tslint also slows down the build by a few seconds. TSLint is a handy tool and its a great idea to use it when doing a full build, but it is a processing step that I would want to exclude when doing livereload/ionic serve. It's not contributing as much to the slowness as the AoT compilation and tree-shaking, but if a speed-optimized build configuration is being worked on, tslint should be excluded as well.

@WhatsThatItsPat
Copy link

@jaufgang Also, considering most of our editors will be linting as we code, it's mostly superfluous during each watch build.

How about a --no-lint flag?

@jaufgang
Copy link

jaufgang commented Oct 4, 2016

i think a fully robust solution would have options to allow you to turn on/off individual build steps like tslint/AoT/tree-shaking via a project config file will different named build configurations, allow you to override those config file settings with command line switches, provide out of the box build configurations for production (slow build, fully optimized output) and dev (fast build, no optimizations)

right now, I'd be happy with any means to speed up livereloading, even some advice on how to hack the app-scripts config files to speed things up while we are waiting for this issue to be addressed in a future release.

@maxkunitsa
Copy link

maxkunitsa commented Oct 6, 2016

In version 0.0.29 some steps in 'ionic serve' was disabled, but still watch in 5 times slower then was previously with gulp. Example:

[09:18:02] bundle dev update started ...
JS changed: www/build/main.js
[09:18:12] bundle dev update finished in 9.72 s
[09:18:12] sass started ...
[09:18:12] sass finished in 16 ms

@Aristona
Copy link

Aristona commented Oct 6, 2016

I'm also having the same issue. It takes like 20 seconds for livereload to reload browser tab even if I simply change a variable value. Gulp was almost instant. It is extremely slow compared to Gulp.

@mhartington
Copy link
Contributor

I just want to add something here.

To the folks who are saying "Gulp was fast and instant", take note that gulp was also doing much less compared to what the build process is doing now.

It's not a fair comparison to make when you consider everything that is going on underneath.
https://github.com/driftyco/ionic-app-scripts#config-defaults

We're iterating quickly and have simplified the watch setup so we can do a bit less. 0.29 is out which has this in there. Also, changing up the npm scripts to match whats in the app base helps keep things up to date.

  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },

@Kobzol
Copy link

Kobzol commented Oct 6, 2016

It's clear that tree shaking, rollup bundling, AOT compilation etc. for production takes much more time than before (with gulp), but the problem is that the dev version is much slower than before. It seems that the TypeScript regression that slowed it down (microsoft/TypeScript#10018 (comment)) will be fixed in the next TS release, what about rollup, is there something that can be done about it to speed it up in dev build (for example turn off tree shaking)?

@jaufgang
Copy link

jaufgang commented Oct 6, 2016

...or even take rollup out of the build altogether for dev builds? Really for dev builds, particularly when using watch/livereload, the only steps that are necessary are compile, concatenate and copy. That's it. Switching from gulp to npm scripts is fine, incorporating rollup and all of those other steps for production builds is great. But for dev builds, anything that slows down the time between start of compilation and viewing the changes in the app or browser is just an annoyance.

@mhartington, you say its not a fair comparison because of everything going on underneath, but that misses the point that all of that extra processing doesn't add value for a dev build.

Why can't you simply create a dev build configuration using the new npm scripts that is functionally equivalent to the previous gulp implementation (compile, concatenate, copy) and keep all of these additional build steps (jslint, AoT compilation, rollup bundling, etc) for production builds?

@jgw96
Copy link
Contributor

jgw96 commented Oct 6, 2016

Hello everyone! We are consistently working on getting our dev builds faster, and you will see improvement on this in the future. I would just like to clarify that the watch task, which runs when running ionic serve does not do AOT compilation, only our prod build (when running ionic run, ionic build or ionic emulate ) does AOT compilation. Thanks!

@tmvnk
Copy link

tmvnk commented Oct 7, 2016

@ionic/app-scripts": "0.0.23" did work with "allowJs": true but "0.0.29" resulting now in SyntaxError: Unexpected character '@'

@marcoturi
Copy link
Contributor

@jaufgang I'm asking myself the same questions. I would add to your point, another question. I saw that with webpack is possible to do hot module reloading (see https://github.com/AngularClass/angular2-webpack-starter). Using rollup we will miss this feature, correct? @adamdbradley

@MarkChrisLevy
Copy link

MarkChrisLevy commented Oct 7, 2016

I totally agree with @jaufgang. I really appreciate work of whole Ionic team (you guys are great!!), but if dev builds will be much slower than it was before rc, then part of the awesomeness of Ionic will be gone. @mhartington IMHO if it is not possible to optimize rollup (as it seems that is the issue) then going back to browserify is an option to think about. Still I so appreciate your amazing job!!! Thanks and no offense ;)

@danielbarla
Copy link

danielbarla commented Oct 8, 2016

I'd just like to add another data point from my side (new to Ionic and busy going through various v2 tutorials): there definitely seems to be something strange happening with watch. I'm using ionic serve, and after a couple of code changes, the rebuild was taking around 80 seconds (on a very decent PC). Strangely, restarting ionic serve (and waiting for the app to come up) was faster than 80 seconds, around 20 in total.

ionic-watch

Above is a screenshot of the console logs from the 80s watch rebuild. At first glance (from the timestamps and durations), it seems like multiple of these 'dev bundle update' are running in parallel, since the logs from 14:00:39 seem to start on 13:59:20. Perhaps this type of thing is causing some locks / delays?

After a restart of ionic serve, rebuilds seem to be taking around 15s.

@danielbarla
Copy link

danielbarla commented Oct 10, 2016

Just a quick follow up to my comment above, after another few days of general usage: the dev bundle / template update times seem to progressively get worse as time goes on. Very roughly, every change seems to add ~2 seconds to the total rebuild time, which very quickly adds up. E.g. on my system when ionic serve is first started, builds take about 12 seconds. After 10 to 20 changes, it's in the 30 - 40 seconds range, which is "reset" when ionic serve is restarted.

The important part is that this seems to be unrelated to what exactly is going on with the build (AOT optimizations, etc), it just gets slower and slower with use, even if you just add and delete a space for each rebuild.

On a side note, congrats to the team on Ionic, it's really an awesome framework so far.

@windwp
Copy link

windwp commented Oct 10, 2016

when I development some time it take over 100 second for build
but it have good performance when it run on phone.
I hope we can fix this issue soon.

@MarkChrisLevy
Copy link

@jgw96 8 pages, but quite complex, lots of other ts files, over 10k LOC (excluding scss and html) and few dependencies to js libraries.

@MarkChrisLevy
Copy link

MarkChrisLevy commented Nov 1, 2016

@danbucholtz Yup, it is because of devtool=source-maps... When I disable it, the times of webpack update are the same as in 0.0.38... Understand, that you cannot do too much with it, so I will override it in my webpack config. Thanks.

Ps. Well, I wanted to buy a brand new MBP, but not happy with the changes that Apple made few days ago.. Still, hardware refreshment is required in my case :-)

@jgw96
Copy link
Contributor

jgw96 commented Nov 1, 2016

@lleevvyy good find! Yeah we are working on using the TypeScript source maps instead of the webpack ones which should fix this (: Thanks for all the debugging

@MarkChrisLevy
Copy link

MarkChrisLevy commented Nov 1, 2016

@danbucholtz @jgw96 Thanks! Great job!

@mirkonasato
Copy link

Just to confirm, 0.0.38 is faster on my machine as well. After a ts change 0.0.38 rebuilds in 1.1-1.2 seconds, with 0.0.39 it goes up to 2.8-2.9 seconds.

And yes I believe the devtool alone can explain the difference. With e.g. devtool: 'eval-source-map' it's pretty much as fast as 0.0.38.

(What's strange is that I don't see the original typescript code, not even with devtool: 'source-map', but that's a separate thing.)

@danbucholtz
Copy link
Contributor

@mirkonasato, in order to support roll-up too, we do the typescript stuff outside of the context of webpack. We have the actual Typescript source code and map available in memory so in version 0.0.40 we are mapping back to that. Seeing some weird results when used in conjunction with AoT right now, though.

I'm glad to here it's still very fast for you. I was worried there for a second. Thanks for testing! 💯

Thanks,
Dan

@maxkunitsa
Copy link

maxkunitsa commented Nov 2, 2016

@danbucholtz @jgw96
Big tnx for replying and attempts to understand 👍
My app: 10 pages, ~ 25 services, ~ 20 classes, ~15 common components used in pages, html/css for each page/component.
My MacBook Pro: Intel Core i5, 2,6 GHz, 8GB DD3 ram, 256 GB SSD

Rollup:
JS: 5-8 seconds for build with 0.0.30 and 15-20 seconds with 0.0.38/0.0.39.
HTML: 5-8 seconds with 0.0.30 and 100-500 ms with 0.0.38/0.0.39.

Webpack
JS: 5-8 seconds for build with 0.0.39
HTML: 300ms - 800ms for build with 0.0.39
but i have error 'Error: Cannot find module "../../common/services/index/"(…)' in console (barrels doesn't work). This file is barrel, something like this:

export * from './utils/color.utils';
export * from './utils/localstorage.utils';
export * from './utils/math.utils';
export * from './utils/uuid.utils';

@Manduro
Copy link
Contributor Author

Manduro commented Nov 2, 2016

@danbucholtz Sure, below are my logs.
App info: ~25 pages, ~100 ts files, multiple dependencies.
Hardware (2010): i5-520M Arrandale, 8GB memory, SATA300 SSD.

Nothing crazy in the logs. Maybe it's just the sourcemap taking much longer on a larger app?

Debug logs:
Initial build ~50s (shows some weird double paths)

[09:18:38]  ionic-app-scripts 0.0.39 
[09:18:38]  watch started ... MEM: 110.7MB 
[09:18:38]  build dev started ... MEM: 110.7MB 
[09:18:38]  clean started ... MEM: 110.7MB 
[ DEBUG! ]  clean /Users/user/path/www/build  MEM: 110.7MB 
[09:18:38]  clean finished in 3 ms MEM: 110.8MB 
[09:18:38]  copy started ... MEM: 110.8MB 
[ DEBUG! ]  worker created, taskModule: lint, pid: 1684  MEM: 111.0MB 
[09:18:38]  transpile started ... MEM: 111.0MB 
[09:18:39]  lint started ... 
[09:18:51]  transpile finished in 12.86 s MEM: 269.7MB 
[09:18:51]  webpack started ... MEM: 269.7MB 
[ DEBUG! ]  Wrote .js files to disk  MEM: 270.8MB 
[ DEBUG! ]  Starting Webpack watch  MEM: 270.9MB 
[09:18:52]  copy finished in 13.94 s MEM: 275.9MB 
[09:19:17]  lint finished in 37.84 s 
[ DEBUG! ]  worker exited, taskModule: lint, pid: 1684  MEM: 714.3MB 
[ DEBUG! ]  Webpack Bundle Updated  MEM: 714.3MB 
[ DEBUG! ]  handleWebpackBuildSuccess: Resolving with Webpack data  MEM: 714.3MB 
[ DEBUG! ]  Cached module paths: 1308, 
            /var/folders/pr/ck8q921d21j8y6d5pmqy4z1c0000gn/T/usersjobdwvdfellofelloclient/modulepaths.json  MEM: 
            715.0MB 
[09:19:23]  webpack finished in 31.94 s MEM: 715.0MB 
[09:19:23]  sass started ... MEM: 715.0MB 
[ DEBUG! ]  sass outFile: /Users/user/path/www/build/main.css  MEM: 715.0MB 
[ DEBUG! ]  sass includePaths: 
            /Users/user/path/src,node_modules/ionic-angular/themes,node_modules/ionicons/dist/scss 
             MEM: 715.0MB 
[ DEBUG! ]  sass moduleDirectories: 244  MEM: 715.0MB 
[ DEBUG! ]  sass userSassVariableFiles: 1  MEM: 714.4MB 
[ DEBUG! ]  sass componentSassFiles: 157  MEM: 714.4MB 
[ DEBUG! ]  sass, start postcss/autoprefixer  MEM: 766.0MB 
[ DEBUG! ]  sass: postcss/autoprefixer completed  MEM: 741.9MB 
[ DEBUG! ]  sass start write output: /Users/user/path/www/build/main.css  MEM: 741.9MB 
[ DEBUG! ]  sass saved output: /Users/user/path/www/build/main.css  MEM: 743.1MB 
[09:19:27]  sass finished in 4.18 s MEM: 743.1MB 
[09:19:27]  build dev finished in 49.01 s MEM: 743.1MB 
[ DEBUG! ]  watcher ready: 
            /Users/user/path/Users/user/path/src/assets/,/Users/user/path/src/index.html,/Users/user/path/src/manifest.json,/Users/user/path/src/service-worker.js,node_modules/ionic-angular/polyfills/polyfills.js,node_modules/ionicons/dist/fonts/
             MEM: 743.8MB 
[ DEBUG! ]  watcher ready: 
            /Users/user/path/Users/user/path/src/assets/,/Users/user/path/src/index.html,/Users/user/path/src/manifest.json,/Users/user/path/src/service-worker.js,node_modules/ionic-angular/polyfills/polyfills.js,node_modules/ionicons/dist/fonts/
             MEM: 743.8MB 
[ DEBUG! ]  watcher ready: 
            /Users/user/path/Users/user/path/src/assets/,/Users/user/path/src/index.html,/Users/user/path/src/manifest.json,/Users/user/path/src/service-worker.js,node_modules/ionic-angular/polyfills/polyfills.js,node_modules/ionicons/dist/fonts/
             MEM: 743.8MB 
[ DEBUG! ]  watcher ready: /Users/user/path/Users/user/path/src/**/*.html  MEM: 
            743.8MB 
[ DEBUG! ]  watcher ready: /Users/user/path/Users/user/path/src/**/*.ts  MEM: 
            743.8MB 
[ DEBUG! ]  watcher ready: /Users/user/path/Users/user/path/src/**/*.scss  MEM: 
            743.8MB 
[ DEBUG! ]  watcher ready: /Users/user/path/Users/user/path/src/**/*  MEM: 
            743.8MB 
[09:19:29]  watch ready in 51.27 s MEM: 743.8MB 

TS file update: ~5-25 seconds, generally ~15.

[ DEBUG! ]  watch callback start, id: 0, isProd: false, event: change, path: 
            /Users/user/path/src/pages/network/network.ts  MEM: 743.9MB 
[09:23:58]  build update started ... MEM: 743.9MB 
[09:23:58]  transpile update started ... MEM: 743.9MB 
[ DEBUG! ]  worker created, taskModule: lint, pid: 1791  MEM: 743.6MB 
[ DEBUG! ]  worker created, taskModule: transpile, pid: 1793  MEM: 743.7MB 
[09:23:59]  transpile update finished in 309 ms MEM: 743.7MB 
[09:23:59]  webpack update started ... MEM: 743.7MB 
[ DEBUG! ]  webpackUpdate: Typescript File Changed  MEM: 743.7MB 
[ DEBUG! ]  webpackUpdate: Transforming paths  MEM: 743.7MB 
[ DEBUG! ]  webpackUpdate: Writing Files to tmp  MEM: 743.7MB 
[ DEBUG! ]  webpackUpdate: Starting Incremental Build  MEM: 743.7MB 
[ DEBUG! ]  worker exited, taskModule: lint, pid: 1791  MEM: 673.3MB 
[ DEBUG! ]  worker exited, taskModule: transpile, pid: 1793  MEM: 673.3MB 
JS changed:   www/build/main.js
[ DEBUG! ]  Webpack Bundle Updated  MEM: 673.3MB 
[ DEBUG! ]  handleWebpackBuildSuccess: Resolving with Webpack data  MEM: 673.3MB 
[ DEBUG! ]  webpackUpdate: Incremental Build Done, processing Data  MEM: 671.6MB 
[ DEBUG! ]  Cached module paths: 1308, 
            /var/folders/pr/ck8q921d21j8y6d5pmqy4z1c0000gn/T/usersuserpath/modulepaths.json  MEM: 
            671.6MB 
[09:24:13]  webpack update finished in 14.68 s MEM: 671.6MB 
[09:24:13]  build update finished in 15.00 s MEM: 671.6MB 
[ DEBUG! ]  watch callback complete, id: 0, isProd: false, event: change, path: 
            /Users/user/path/src/pages/network/network.ts  MEM: 671.6MB 

[09:24:13]  watch ready 

HTML file update:

[ DEBUG! ]  watch callback start, id: 1, isProd: false, event: change, path: 
            /Users/user/path/src/pages/network/network.html  MEM: 671.6MB 
[09:25:35]  template update started ... MEM: 671.6MB 
[ DEBUG! ]  templateUpdate, event: change, path: /Users/user/path/src/pages/network/network.html  
            MEM: 671.6MB 
[ DEBUG! ]  templateUpdate: updating webpack file  MEM: 671.6MB 
[09:25:35]  build update started ... MEM: 671.6MB 
[09:25:35]  transpile update started ... MEM: 671.6MB 
[ DEBUG! ]  worker created, taskModule: lint, pid: 1834  MEM: 671.6MB 
[ DEBUG! ]  worker created, taskModule: transpile, pid: 1835  MEM: 671.6MB 
[09:25:35]  transpile update finished in 224 ms MEM: 671.6MB 
[09:25:35]  webpack update started ... MEM: 671.6MB 
[ DEBUG! ]  webpackUpdate: Typescript File Changed  MEM: 671.6MB 
[ DEBUG! ]  webpackUpdate: Transforming paths  MEM: 671.6MB 
[ DEBUG! ]  webpackUpdate: Writing Files to tmp  MEM: 671.6MB 
[ DEBUG! ]  webpackUpdate: Starting Incremental Build  MEM: 671.6MB 
[ DEBUG! ]  Webpack Bundle Updated  MEM: 589.5MB 
[ DEBUG! ]  handleWebpackBuildSuccess: Resolving with Webpack data  MEM: 589.5MB 
[ DEBUG! ]  webpackUpdate: Incremental Build Done, processing Data  MEM: 591.6MB 
[ DEBUG! ]  Cached module paths: 1308, 
            /var/folders/pr/ck8q921d21j8y6d5pmqy4z1c0000gn/T/usersuserpath/modulepaths.json  MEM: 
            591.6MB 
[09:25:42]  webpack update finished in 6.85 s MEM: 591.6MB 
[09:25:42]  build update finished in 7.08 s MEM: 591.6MB 
[09:25:42]  template update finished in 7.08 s MEM: 591.6MB 
[ DEBUG! ]  watch callback complete, id: 1, isProd: false, event: change, path: 
            /Users/user/path/src/pages/network/network.html  MEM: 591.6MB 

[09:25:42]  watch ready 

[ DEBUG! ]  worker exited, taskModule: lint, pid: 1834  MEM: 591.6MB 
[ DEBUG! ]  worker exited, taskModule: transpile, pid: 1835  MEM: 591.6MB 

SASS update:

[ DEBUG! ]  watch callback start, id: 2, isProd: false, event: change, path: 
            /Users/user/path/src/theme/fonts.scss  MEM: 591.6MB 
[09:27:08]  sass update started ... MEM: 591.6MB 
[ DEBUG! ]  sass outFile: /Users/user/path/www/build/main.css  MEM: 591.6MB 
[ DEBUG! ]  sass includePaths: 
            /Users/user/path/src,/Users/user/path/src,node_modules/ionic-angular/themes,node_modules/ionicons/dist/scss
             MEM: 591.6MB 
[ DEBUG! ]  sass moduleDirectories: 244  MEM: 591.6MB 
[ DEBUG! ]  sass userSassVariableFiles: 1  MEM: 591.6MB 
[ DEBUG! ]  sass componentSassFiles: 157  MEM: 591.6MB 
[ DEBUG! ]  sass, start postcss/autoprefixer  MEM: 622.5MB 
[ DEBUG! ]  sass: postcss/autoprefixer completed  MEM: 616.8MB 
[ DEBUG! ]  sass start write output: /Users/user/path/www/build/main.css  MEM: 616.8MB 
CSS changed:  www/build/main.css
[ DEBUG! ]  sass saved output: /Users/user/path/www/build/main.css  MEM: 611.7MB 
[09:27:11]  sass update finished in 3.61 s MEM: 611.7MB 
[ DEBUG! ]  watch callback complete, id: 2, isProd: false, event: change, path: 
            /Users/user/path/src/theme/fonts.scss  MEM: 611.7MB 

[09:27:11]  watch ready 

@danbucholtz
Copy link
Contributor

@maxkunitsa, can you open a separate issue for that? We'll get it fixed.

@Manduro, if the build is taking too long, the best bet may be to override the webpack.config.js by following the docs here and providing a devtool value of eval. That will speed things up but the source maps will be lower quality and won't work as well.

Thanks,
Dan

@pascalwhoop
Copy link
Contributor

Hi guys. I figured out that node version v5.11.1 is much faster than version v6.7.0 for mac users. what versions are you guys using?

@maxkunitsa
Copy link

@pascalwhoop tried node 7.0.0, 5.11.1 and 6.9.1 no any difference.

@Weezlo
Copy link

Weezlo commented Nov 6, 2016

Tried everything, but nothing worked.
I've finally updated app-scripts to 0.0.39 (was 0.0.36) and there is a huge improvement for both windows and Ubuntu. From ~30/40sec for every modification on a source file to ~10sec.
"ionic run" is also faster.
This worked for me:
npm install @ionic/app-scripts@latest --save-dev

@danbucholtz
Copy link
Contributor

The watch is significant faster now, so I am going to close this issue for now. I consistently see builds between 750-1500ms. We have a few more optimizations we'll make over the coming weeks as well.

Thanks,
Dan

@MarkChrisLevy
Copy link

@danbucholtz Thank you very, very much for your work!!!! I can confirm, that it is lightning fast with latest releases.

@danbucholtz
Copy link
Contributor

@lleevvyy, really happy to hear that! 😄 . We have a few more optimizations in mind that we'll give a try in the coming weeks.

Thanks,
Dan

@Manduro
Copy link
Contributor Author

Manduro commented Nov 11, 2016

@danbucholtz Thanks a lot for all the work you are putting in!! Things have certainly improved A LOT :)

@raducostea
Copy link

Yes. but for me right now the fastest version remains 0.0.38 with about 1.2 s build time. The latest one takes about 4-5 seconds.

@devarg
Copy link

devarg commented Nov 12, 2016

@danbucholtz Not fast, blazing fast! I'm having a 600% (Yep, 6 hundred) improvement from that buggy 0.38 to the latest. Out-stand-ing.

@mirkonasato
Copy link

Is it just me or 0.0.47 seems about twice as slow compared to 0.0.46?

@danbucholtz
Copy link
Contributor

danbucholtz commented Dec 14, 2016

@mirkonasato,

We reverted back to source-map instead of eval for the webpack devtool. You can change it back by setting ionic_source_map_type in the package.json config. I personally prefer the faster speeds to an original, high quality source map but the team decided to go with the better map.

Thanks,
Dan

@mirkonasato
Copy link

@danbucholtz thanks, but there other options available that offer a better speed/quality tradeoff for development. Webpack 2 defaults to eval-cheap-module-source-map.

(And eval doesn't seem to be working properly anyway, but that's a separate issue.)

@danbucholtz
Copy link
Contributor

@mirkonasato,

Believe me, I exhaustively looked into the options and was very disappointed to see breakpoints not work correctly, get hit at wrong times, etc. eval and source-map worked best for us. I am very open to changing this if it works correctly.

What isn't working with eval? I have used the eval maps successfully in testing. Was able to set and hit breakpoints as expected, etc.

Thanks,
Dan

@mirkonasato
Copy link

mirkonasato commented Dec 15, 2016

@danbucholtz eval actually works fine, sorry. Just have to close and re-open the app after changing source map type, otherwise Chrome somehow gets confused.

I'd just like a devtool option that shows file and line number in the DevTools console rather than something like VM1470:18.

@mohamedsharaf
Copy link

mohamedsharaf commented Jan 3, 2017

can u please tell me which package.json to change the
ionic_source_map_type
to
eval

@mirkonasato @danbucholtz

i cant find any of this settings
package.json in project folder or some where else

i added this to package.json of project folder
"IONIC_SOURCE_MAP_TYPE": "eval",
but with no improvement in performance

@danbucholtz
Copy link
Contributor

...
"config" : {
   "ionic_source_map_type" : "eval"
}
...

To be clear, config is a root node. It should result in a faster development build.

Thanks,
Dan

@mohamedsharaf
Copy link

thx 2 or 3 second faster

[05:19:15] build started ...
[05:19:15] transpile update started ...
[05:19:15] transpile update finished in 83 ms
[05:19:15] webpack update started ...
[05:19:20] webpack update finished in 5.25 s
[05:19:22] build finished in 7.41 s

@sean-hill
Copy link

I'm currently using @ionic/app-scripts v1.3.7 and my webpack update is taking over 45 seconds to complete 😢

@danbucholtz
Copy link
Contributor

@sean-hill,

How do I recreate? That seems strange to me. Can you dive in and provide more info. Maybe open another issue with some details.

Thanks,
Dan

@ionic-team ionic-team locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests