镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

working with the nodejs Benchmarking WG #1118

Closed

Description

@trevnorris

An official Benchmarking WG has been created for the nodejs foundation (information on https://github.com/nodejs/benchmarking). We are investigating ways to more thoroughly detect performance regression over different versions. Part of this has been discussion around using larger scale benchmarks, instead of relying so heavily on the micro benchmarks commonly used.

Are there any examples of an extremely complicated build? We'd like to be able to track as much information as possible.

Activity

  1. yocontra commented on Jun 23, 2015

    @yocontra
    Member

    @trevnorris I can provide assistance if you need any help - google web starter kit would be a good one to look at, but that is based on the 3.0 branch. If you are starting a new project you should definitely use 4.0 which is much simpler and more flexible for complex stuff.

  2. callumacrae commented on Jun 23, 2015

    @callumacrae
    Member

    In terms of the amount of stuff it's doing, the gulptask I wrote for work is pretty huge and complicated, but it is closed source and not written like a typical gulpfile.

    'use strict';
    
    var path = require('path');
    var gulp = require('gulp');
    var findModulesDown = require('find-node-modules-down');
    var getLmnTask = require('lmn-gulp-tasks');
    
    var buildRoot = process.env.MERMAID_BUILD_ROOT || '.';
    var assetPath = process.env.MERMAID_ASSET_PATH || 'assets/mermaid';
    var buildPath = path.resolve(path.join(buildRoot, 'public', assetPath));
    var imageCache = path.join(buildPath, 'src_cache');
    
    var assetHost;
    if (process.env.ASSET_HOST) {
      assetHost = 'https://' + process.env.ASSET_HOST + '/';
    } else {
      assetHost = '/';
    }
    
    function getTask(name, options) {
      if (typeof options !== 'object') {
        options = {};
      }
    
      if (typeof options.rev !== 'boolean') {
        options.rev = true;
      }
    
      options.manifest = buildPath;
    
      return getLmnTask(name, options);
    }
    
    gulp.task('auto-reload', getTask('auto-reload'));
    
    gulp.task('js', getTask('browserify', {
      src: './src/js/script.js',
      dest: path.join(buildPath, 'js/bundle.js')
    }));
    
    gulp.task('js-quality', getTask('js-quality', {
        src: ['./src/**/*.js', '!./src/**/*.min.js']
    }));
    
    gulp.task('scss', getTask('scss', {
      src: './src/scss/*.{sass,scss}',
      dest: path.join(buildPath, 'stylesheets'),
      imagePath: assetHost + path.join(assetPath, 'images'),
      includePaths: findModulesDown()
    }));
    
    gulp.task('fonts', getTask('copy', {
      src: './src/scss/themes/**/*.{ttf,woff,eot,svg}',
      dest: path.join(buildPath, 'fonts'),
      flatten: true
    }));
    
    gulp.task('src-copy', getTask('copy', {
      src: './src/**/*.{png,jpg,gif}',
      dest: imageCache,
      rev: false
    }));
    
    gulp.task('responsive-images', ['src-copy'], getTask('responsive-images', {
      src: [
        './node_modules/lmn.jester.component.*/src/images/**/*.{png,jpg,gif}',
        './node_modules/lmn-monkey/src/**/*.{png,jpg,gif}',
        path.join(imageCache, '**/*.{png,jpg,gif}')
      ],
      dest: path.join(buildPath, 'images'),
      lossless: function (file) {
        return file.path.indexOf('hero') !== -1;
      },
      flatten: true
    }));
    
    gulp.task('optimise-svgs', getTask('optimise-svgs', {
      src: [
        './node_modules/lmn.jester.component.*/src/images/**/*.svg',
        './node_modules/lmn-monkey/src/imgs/**/*.svg',
        './src/components/**/*.svg',
        './src/images/**/*.svg'
      ],
      dest: path.join(buildPath, 'images'),
      flatten: true
    }));
    
    gulp.task('icons', getTask('copy', {
      src: './src/icons/*.{ico,png}',
      dest: path.join(buildPath, 'images')
    }));
    
    gulp.task('clean', getTask('clean', {
      src: [buildPath, 'rev-manifest.json']
    }));
    
    gulp.task('watchers', function () {
      gulp.watch('./src/**/*.{sass,scss}', ['scss']);
      gulp.watch('./node_modules/lmn.jester.*/**/*.scss', ['scss']);
      gulp.watch('./src/**/*.js', ['js']);
    });
    
    gulp.task('images',  ['responsive-images', 'optimise-svgs', 'icons']);
    gulp.task('lint',    ['js-quality']);
    gulp.task('build',   ['images', 'fonts', 'js'], function () {
      // THIS IS A HORRIBLE HACK NEVER EVER USE GULP.RUN
      // SERIOUSLY PLEASE DONT
      gulp.run(['scss']);
    });
    
    gulp.task('default', ['lint', 'build', 'watchers']);

    https://github.com/lostmyname/lmn-gulp-tasks

    Hopefully going to be upgrading to Gulp 4 pretty soon.

  3. trevnorris commented on Jun 23, 2015

    @trevnorris
    Author

    @contra I believe we're going to start back with v0.10 to see how performance has improved, or not, over the last couple years. Will 4 work with v0.10?

    @callumacrae Great example. Thanks for sharing.

  4. yocontra commented on Jun 23, 2015

    @yocontra
    Member

    @trevnorris Yep the whole ecosystem is strictly 0.10+ so you should be totally fine there 👍

  5. sindresorhus commented on Jul 3, 2015

    @sindresorhus
    Contributor
  6. yocontra commented on Aug 27, 2015

    @yocontra
    Member

    Closing due to no response

  7. trevnorris commented on Sep 1, 2015

    @trevnorris
    Author

    @contra Sorry about the delay. Most of the benchmark WG are also on other WG. With the v4.0 (which is also the first "official" LTS release) we've been mostly lost in other things.

    The gulp files provided are an excellent starting point to help us get a proper suit of macro-benchmarks running. Will have more feedback once a system for running these is up and running. Thanks again for the feedback and scripts for testing.

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