CLI performance
See original GitHub issueI just started using ESLint in Vim (through Syntactic, as suggested in the Readme). It works great, but it’s a little slow, blocking the UI when opening or saving files, because Vim can’t run tasks in the background. So I made a few quick checks (on a new MacBook, 1.1 GHz Intel Core M w/ flash drive):
Overall execution time on a very simple file with an empty ES 6 class definition:
$ time node_modules/.bin/eslint test.js
real 0m0.787s
user 0m0.700s
sys 0m0.082s
Node v4.0.0 launch time:
$ time node -p 'console.log("");'
real 0m0.134s
user 0m0.110s
sys 0m0.021s
Adding console.time()
and console.timeEnd()
around bin/eslint.js require statements, produced timings between 362ms
and 425ms
.
This means that the actual execution time of ESLint isn’t bad at all, but especially loading all the modules cause it to feel slow in my use case.
Another Vim plugin I use is ternjs and it uses a very nice trick: They launch a server process in the background and a light weight client sends commands to the server. I was thinking that this approach could work for ESLint as well, causing all the heavy modules to be loaded only once. This could be realized as a separate project, or might be built into ESLint itself.
What do you think?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Ok, I’ve made a little something: https://www.npmjs.com/package/eslint_d The speedup is quite remarkable and exceeds my expectations. Thanks for ESLint!
Thank you for sharing @mantoni, it really makes a huge difference. Nice job!