{"action":"created","comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments/37708586","id":37708586,"diff_hunk":"@@ -811,6 +813,23 @@ RuboCop::RakeTask.new(:rubocop) do |task|\n end\n ```\n \n+## Caching\n+\n+Large projects containing hundreds or even thousands of files can take\n+a really long time to inspect, but RuboCop has functionality to\n+mitigate this problem. A result caching mechanism is activated if the","path":"README.md","position":24,"original_position":24,"commit_id":"17a8b6e0d272859ec82367f6aca46a4055150348","original_commit_id":"17a8b6e0d272859ec82367f6aca46a4055150348","user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"body":"I think the term \"result\" is kind of confusing/unclear. I'd suggest elaborating on this.","created_at":"2015-08-23T17:32:15Z","updated_at":"2015-08-23T17:32:15Z","html_url":"https://github.com/bbatsov/rubocop/pull/2153#discussion_r37708586","pull_request_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153","_links":{"self":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments/37708586"},"html":{"href":"https://github.com/bbatsov/rubocop/pull/2153#discussion_r37708586"},"pull_request":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153"}}},"pull_request":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153","id":42540256,"html_url":"https://github.com/bbatsov/rubocop/pull/2153","diff_url":"https://github.com/bbatsov/rubocop/pull/2153.diff","patch_url":"https://github.com/bbatsov/rubocop/pull/2153.patch","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2153","number":2153,"state":"open","locked":false,"title":"[Fix #1924] Use a cache to speed things up","user":{"login":"jonas054","id":336720,"avatar_url":"https://avatars.githubusercontent.com/u/336720?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"body":"I've been working on this for a while, and feel ready to make a pull request. The performance of RuboCop has been discussed lately, so I guess this would be welcomed by some users.\r\n\r\nCache invalidation is generally a hard problem, but I think this solution should work (knock on wood). It uses the source code of the `rubocop` executable, a selection of the passed options, the inspected file, and its configuration as basis.\r\n\r\nAdd `--cache` option and `AlwaysRunWithCache` configuration parameter (`false` by default). Store a cache of inspection results at `/tmp/rubocop_cache/` (or whatever the temporary directory is). Clean up when it gets too big (governed by the configuration parameter `MaxFilesInCache`).\r\n\r\n**Performace**\r\n\r\nThere's a slight performance penalty for storing cached results while inspecting files, around 2%, which is why I chose to only store in the cache if the option is given. The execution when there are cached results to reuse is typically between 10 and 30 times faster.","created_at":"2015-08-16T17:56:13Z","updated_at":"2015-08-23T17:32:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84f44b7a324d61725178c7dcec4fb7989ef03600","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153/commits","review_comments_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153/comments","review_comment_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2153/comments","statuses_url":"https://api.github.com/repos/bbatsov/rubocop/statuses/17a8b6e0d272859ec82367f6aca46a4055150348","head":{"label":"jonas054:cache_option","ref":"cache_option","sha":"17a8b6e0d272859ec82367f6aca46a4055150348","user":{"login":"jonas054","id":336720,"avatar_url":"https://avatars.githubusercontent.com/u/336720?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"repo":{"id":6784696,"name":"rubocop","full_name":"jonas054/rubocop","owner":{"login":"jonas054","id":336720,"avatar_url":"https://avatars.githubusercontent.com/u/336720?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonas054/rubocop","description":"A robust Ruby code analyzer, based on the community Ruby style guide.","fork":true,"url":"https://api.github.com/repos/jonas054/rubocop","forks_url":"https://api.github.com/repos/jonas054/rubocop/forks","keys_url":"https://api.github.com/repos/jonas054/rubocop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonas054/rubocop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonas054/rubocop/teams","hooks_url":"https://api.github.com/repos/jonas054/rubocop/hooks","issue_events_url":"https://api.github.com/repos/jonas054/rubocop/issues/events{/number}","events_url":"https://api.github.com/repos/jonas054/rubocop/events","assignees_url":"https://api.github.com/repos/jonas054/rubocop/assignees{/user}","branches_url":"https://api.github.com/repos/jonas054/rubocop/branches{/branch}","tags_url":"https://api.github.com/repos/jonas054/rubocop/tags","blobs_url":"https://api.github.com/repos/jonas054/rubocop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonas054/rubocop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonas054/rubocop/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonas054/rubocop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonas054/rubocop/statuses/{sha}","languages_url":"https://api.github.com/repos/jonas054/rubocop/languages","stargazers_url":"https://api.github.com/repos/jonas054/rubocop/stargazers","contributors_url":"https://api.github.com/repos/jonas054/rubocop/contributors","subscribers_url":"https://api.github.com/repos/jonas054/rubocop/subscribers","subscription_url":"https://api.github.com/repos/jonas054/rubocop/subscription","commits_url":"https://api.github.com/repos/jonas054/rubocop/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonas054/rubocop/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonas054/rubocop/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonas054/rubocop/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonas054/rubocop/contents/{+path}","compare_url":"https://api.github.com/repos/jonas054/rubocop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonas054/rubocop/merges","archive_url":"https://api.github.com/repos/jonas054/rubocop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonas054/rubocop/downloads","issues_url":"https://api.github.com/repos/jonas054/rubocop/issues{/number}","pulls_url":"https://api.github.com/repos/jonas054/rubocop/pulls{/number}","milestones_url":"https://api.github.com/repos/jonas054/rubocop/milestones{/number}","notifications_url":"https://api.github.com/repos/jonas054/rubocop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonas054/rubocop/labels{/name}","releases_url":"https://api.github.com/repos/jonas054/rubocop/releases{/id}","created_at":"2012-11-20T20:34:59Z","updated_at":"2014-11-08T07:23:45Z","pushed_at":"2015-08-23T11:16:04Z","git_url":"git://github.com/jonas054/rubocop.git","ssh_url":"git@github.com:jonas054/rubocop.git","clone_url":"https://github.com/jonas054/rubocop.git","svn_url":"https://github.com/jonas054/rubocop","homepage":"","size":11390,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbatsov:master","ref":"master","sha":"0f260a67fd125697b0600f79f4457d5c17df0b70","user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"repo":{"id":4095287,"name":"rubocop","full_name":"bbatsov/rubocop","owner":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbatsov/rubocop","description":"A Ruby static code analyzer, based on the community Ruby style guide.","fork":false,"url":"https://api.github.com/repos/bbatsov/rubocop","forks_url":"https://api.github.com/repos/bbatsov/rubocop/forks","keys_url":"https://api.github.com/repos/bbatsov/rubocop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbatsov/rubocop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbatsov/rubocop/teams","hooks_url":"https://api.github.com/repos/bbatsov/rubocop/hooks","issue_events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/events{/number}","events_url":"https://api.github.com/repos/bbatsov/rubocop/events","assignees_url":"https://api.github.com/repos/bbatsov/rubocop/assignees{/user}","branches_url":"https://api.github.com/repos/bbatsov/rubocop/branches{/branch}","tags_url":"https://api.github.com/repos/bbatsov/rubocop/tags","blobs_url":"https://api.github.com/repos/bbatsov/rubocop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbatsov/rubocop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbatsov/rubocop/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbatsov/rubocop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbatsov/rubocop/statuses/{sha}","languages_url":"https://api.github.com/repos/bbatsov/rubocop/languages","stargazers_url":"https://api.github.com/repos/bbatsov/rubocop/stargazers","contributors_url":"https://api.github.com/repos/bbatsov/rubocop/contributors","subscribers_url":"https://api.github.com/repos/bbatsov/rubocop/subscribers","subscription_url":"https://api.github.com/repos/bbatsov/rubocop/subscription","commits_url":"https://api.github.com/repos/bbatsov/rubocop/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbatsov/rubocop/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbatsov/rubocop/contents/{+path}","compare_url":"https://api.github.com/repos/bbatsov/rubocop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbatsov/rubocop/merges","archive_url":"https://api.github.com/repos/bbatsov/rubocop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbatsov/rubocop/downloads","issues_url":"https://api.github.com/repos/bbatsov/rubocop/issues{/number}","pulls_url":"https://api.github.com/repos/bbatsov/rubocop/pulls{/number}","milestones_url":"https://api.github.com/repos/bbatsov/rubocop/milestones{/number}","notifications_url":"https://api.github.com/repos/bbatsov/rubocop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbatsov/rubocop/labels{/name}","releases_url":"https://api.github.com/repos/bbatsov/rubocop/releases{/id}","created_at":"2012-04-21T10:09:58Z","updated_at":"2015-08-23T03:18:10Z","pushed_at":"2015-08-23T13:16:56Z","git_url":"git://github.com/bbatsov/rubocop.git","ssh_url":"git@github.com:bbatsov/rubocop.git","clone_url":"https://github.com/bbatsov/rubocop.git","svn_url":"https://github.com/bbatsov/rubocop","homepage":"","size":21317,"stargazers_count":4983,"watchers_count":4983,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":565,"mirror_url":null,"open_issues_count":105,"forks":565,"open_issues":105,"watchers":4983,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153"},"html":{"href":"https://github.com/bbatsov/rubocop/pull/2153"},"issue":{"href":"https://api.github.com/repos/bbatsov/rubocop/issues/2153"},"comments":{"href":"https://api.github.com/repos/bbatsov/rubocop/issues/2153/comments"},"review_comments":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153/comments"},"review_comment":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2153/commits"},"statuses":{"href":"https://api.github.com/repos/bbatsov/rubocop/statuses/17a8b6e0d272859ec82367f6aca46a4055150348"}}}}