{"action":"created","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1996","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1996/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1996/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1996/events","html_url":"https://github.com/jscs-dev/node-jscs/issues/1996","id":119561105,"number":1996,"title":"jscs startup takes ~1.5s","user":{"login":"toupeira","id":6501,"avatar_url":"https://avatars.githubusercontent.com/u/6501?v=3","gravatar_id":"","url":"https://api.github.com/users/toupeira","html_url":"https://github.com/toupeira","followers_url":"https://api.github.com/users/toupeira/followers","following_url":"https://api.github.com/users/toupeira/following{/other_user}","gists_url":"https://api.github.com/users/toupeira/gists{/gist_id}","starred_url":"https://api.github.com/users/toupeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toupeira/subscriptions","organizations_url":"https://api.github.com/users/toupeira/orgs","repos_url":"https://api.github.com/users/toupeira/repos","events_url":"https://api.github.com/users/toupeira/events{/privacy}","received_events_url":"https://api.github.com/users/toupeira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-30T19:21:28Z","updated_at":"2015-11-30T19:52:18Z","closed_at":null,"body":"This is on a recent i7 quad-core with SSD and plenty of RAM, running Debian sid:\r\n\r\n```sh\r\n$ time nodejs --version\r\nv4.2.2\r\n\r\nreal    0m0.006s\r\nuser    0m0.004s\r\nsys     0m0.000s\r\n$ time npm --version\r\nv1.4.21\r\n\r\nreal    0m0.469s\r\nuser    0m0.480s\r\nsys     0m0.008s\r\n$ mkdir /tmp/jscs\r\n$ cd /tmp/jscs\r\n$ time node --prof /usr/local/bin/jscs --version\r\n2.6.0\r\n\r\nreal    0m1.749s\r\nuser    0m1.768s\r\nsys     0m0.160s\r\n```\r\n\r\nI did the test in an empty directory because I first noticed the issue when running `jscs` in a large(ish) project and wanted to see if it makes a difference.\r\n\r\nSee the [attached log output](https://github.com/jscs-dev/node-jscs/files/47667/v8.log.txt) from `node --prof`, you can analyze it by installing [`node-tick`](https://github.com/sidorares/node-tick) and running `node-tick-processor v8.log.txt`.\r\n\r\n`strace` also shows a *lot* of syscalls for the files below `node_modules`, so I guess that has something to do with it.  Not sure how much of this can be realisitically optimized, the slow startup time of `npm` itself suggests a more general issue here :)\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28723849-jscs-startup-takes-1-5s?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/comments/160739763","html_url":"https://github.com/jscs-dev/node-jscs/issues/1996#issuecomment-160739763","issue_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1996","id":160739763,"user":{"login":"toupeira","id":6501,"avatar_url":"https://avatars.githubusercontent.com/u/6501?v=3","gravatar_id":"","url":"https://api.github.com/users/toupeira","html_url":"https://github.com/toupeira","followers_url":"https://api.github.com/users/toupeira/followers","following_url":"https://api.github.com/users/toupeira/following{/other_user}","gists_url":"https://api.github.com/users/toupeira/gists{/gist_id}","starred_url":"https://api.github.com/users/toupeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toupeira/subscriptions","organizations_url":"https://api.github.com/users/toupeira/orgs","repos_url":"https://api.github.com/users/toupeira/repos","events_url":"https://api.github.com/users/toupeira/events{/privacy}","received_events_url":"https://api.github.com/users/toupeira/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T19:52:18Z","updated_at":"2015-11-30T19:52:18Z","body":"@hzoo thanks for the hint, on first look it doesn't seem to make a difference:\r\n\r\n```sh\r\n$ time npm --version\r\n3.5.0\r\n\r\nreal    0m0.462s\r\nuser    0m0.472s\r\nsys     0m0.012s\r\n$ time node_modules/jscs/bin/jscs --version\r\n2.6.0\r\n\r\nreal    0m1.597s\r\nuser    0m1.612s\r\nsys     0m0.056s\r\n```\r\n\r\nThis time I ran the test inside the project folder, since I could just quickly blow away `node_modules` there and reinstall. Some dependencies are still nested though because of version differences:\r\n\r\n```sh\r\n$ ls node_modules/jscs/node_modules/\r\nansi-regex  chalk      esprima     glob      js-yaml    resolve     supports-color\r\nargparse    commander  estraverse  has-ansi  minimatch  strip-ansi\r\n```\r\n\r\nCan somebody else confirm faster startup time with npm3? In that case I wouldn't mind closing this issue."}}