Skip to content

Watch constant CPU usage on Windows #287

Description

@philjones88

Hi,
Been bashing my head against a wall thinking I'm doing something stupid but, I can't figure out why I get constant CPU usage using Gulp watch().

I see "node.exe" takes 2-5% CPU all the time Gulp's watch is running.

Node -v = v0.10.25
Gulp -v = 3.5.2
Windows 8.1

I have pretty standard code I think. Anyone seen this or can help debug why this is happening?

gulp.task('watch', function () {
    var server = livereload();
    gulp.watch(config.scripts_lib, ['scripts_lib_dev']).on('change', function (file) {
        server.changed(file.path);
    });
    gulp.watch(config.scripts_app, ['scripts_app_dev']).on('change', function (file) {
        server.changed(file.path);
    });
    gulp.watch(config.templates, ['templates_dev']).on('change', function (file) {
        server.changed(file.path);
    });
});
gulp.task('scripts_lib_dev', function () {
    return gulp.src(config.scripts_libs)
      .pipe(concat('foo.lib.js'))
      .pipe(gulp.dest('static/js'));
});
gulp.task('scripts_app_dev', function () {
    return gulp.src(config.scripts_app)
      .pipe(concat('foo.app.js'))
      .pipe(gulp.dest('static/js'));
});
gulp.task('templates_dev', function () {
    return gulp.src(config.templates)
       .pipe(templateCache({
           standalone: true,
           module: 'foo.templates'
       }))
       .pipe(concat('foo.templates.js'))
       .pipe(gulp.dest('static/js'));
});

Where config is an object is lists of paths.
scripts_libs = 12 file paths
scripts_app = 13 file paths
templates = selector "static/js/app/*/.html"

Activity

  1. yocontra commented on Feb 19, 2014

    @yocontra
    Member
  2. yocontra commented on Feb 19, 2014

    @yocontra
    Member

    It's an underlying module. It will be fixed soon.

  3. gwynjudd commented on Oct 29, 2014

    @gwynjudd

    Is this still outstanding? I'm seeing a very similar issue

    C:\Users\gjudd\Source\Mobility\dev branches\Develop\Touch\Touch> gulp -v
    [12:04:09] CLI version 3.8.9
    [12:04:09] Local version 3.8.9
    C:\Users\gjudd\Source\Mobility\dev branches\Develop\Touch\Touch> node -v
    v0.10.31

  4. yocontra commented on Oct 30, 2014

    @yocontra
    Member

    @gwynjudd See the issue I linked, this is a duplicate

  5. gwynjudd commented on Oct 30, 2014

    @gwynjudd

    @contra ok thanks I just wanted to confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions