Skip to content

Instantly share code, notes, and snippets.

@gyandeeps
Last active September 24, 2015 19:09
Show Gist options
  • Select an option

  • Save gyandeeps/300c6061e93ae9d834b8 to your computer and use it in GitHub Desktop.

Select an option

Save gyandeeps/300c6061e93ae9d834b8 to your computer and use it in GitHub Desktop.
Lazy lading rules experiment

Here is my project structure:

app
  - makefile.js
  - test.js
  - test
     - app.js
     - app1
       -- app1.js

Here is how I measured the eslint run using the Makefile concept.

console.time("Makefile run");
nodeCli.exec("eslint", "./");
console.timeEnd("Makefile run");

Runs

With 5 rules active

Regular loading

Makefile run: 958ms

Lazy loading

Makefile run: 830ms

With 41 rules active

Regular loading

Makefile run: 989ms

Lazy loading

Makefile run: 882ms

With ALL rules active

Regular loading

Makefile run: 1173ms

Lazy loading

Makefile run: 1128ms

Notes

  • If we only require the config-initializer module only when someone has the init flag on then we save 70ms. So basically from the above times just subtract 70ms.
    • The reason is inquirer module load time is high
  • This can be achieved with minimum changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment