Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
gulp-ll
Advanced tools
Readme
Ugly workaround for this imperfect world where we don't have threads in Node.
Run CPU-consuming Gulp tasks in the separate processes to achieve faster builds.
npm install --save-dev gulp-ll
Declare which tasks should be run in parallel before any task declaration:
var gulp = require('gulp');
var ll = require('gulp-ll');
ll.tasks(['lint', 'compile-scripts']);
gulp.task('lint', ['dep'], () => {
// Task code...
});
gulp.task('compile-scripts', ['dep'], () => {
// Task code...
});
gulp.task('dep', () => {
// This task will run in the master process ONCE before 'lint' and 'compile-scripts' begin.
});
And we're set :tada:
It depends. Node processes are quite slow to spawn. So, running tasks in the separate processes could be
slower than executing them sequentially in the single process. You need to play a little bit with the
configuration (using time gulp your-task
) to figure out the optimal one. E.g. I was able to reach maximum
performance (~30% faster) by using gulp-ll only for the the heaviest CPU-consuming task out of 3 in my project.
Performance gain also depends on the codebase size: obviously, it will give better results in the big projects.
Node process may become painfully slow in the debugging mode. Sometimes, when you trying to debug your tests by
running test
task that depends on scripts compilation, linting, etc. it may take ages to reach the desired breakpoint.
This is there gulp-ll come in handy - it will run heavy gulp tasks in the separate processes with the regular speed.
Taking in consideration what was told in the previous paragraph, more likely you will not want to run all your heavy
tasks in the separate processes. But, you can force them to to do so only in the debug:
ll
// Always run in separate process
.tasks('lint');
// Run in separate process only in debug
.onlyInDebug('compile-scripts', 'build-templates');
You can just disable gulp-ll by running Gulp with --no-ll
parameter:
gulp my-task --no-ll
More likely gulp-ll will not work for you if you have global variables set by one task and used by another. Apart from the topic, I suggest you to never do so.
FAQs
Run CPU-consuming Gulp tasks in the separate processes to achieve faster builds.
The npm package gulp-ll receives a total of 216 weekly downloads. As such, gulp-ll popularity was classified as not popular.
We found that gulp-ll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.