{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/72343386","id":72343386,"diff_hunk":"@@ -3373,6 +3373,91 @@ describe('$compile', function() {\n     });\n   });\n \n+  describe('collector', function() {\n+\n+    var collected;\n+    beforeEach(module(function($compileProvider) {\n+      collected = false;\n+      $compileProvider.directive('testCollect', function() {\n+        return {\n+          restrict: 'EACM',\n+          link: function() {\n+            collected = true;\n+          }\n+        };\n+      });\n+    }));\n+\n+    it('should collect comment directives by default', inject(function() {\n+      var html = '<!-- directive: test-collect -->';\n+      element = $compile('<div>' + html + '</div>')($rootScope);\n+      expect(collected).toBe(true);\n+    }));\n+\n+    it('should collect css class directives by default', inject(function() {\n+      element = $compile('<div class=\"test-collect\"></div>')($rootScope);\n+      expect(collected).toBe(true);\n+    }));\n+\n+    angular.forEach([\n+      { commentEnabled: true, cssEnabled: true },\n+      { commentEnabled: true, cssEnabled:false },\n+      { commentEnabled:false, cssEnabled: true },\n+      { commentEnabled:false, cssEnabled:false }\n+    ], function(config) {\n+      describe('commentDirectivesEnabled(' + config.commentEnabled + ')', function() {\n+        describe('cssClassDirectivesEnabled(' + config.cssEnabled + ')', function() {","path":"test/ng/compileSpec.js","position":37,"original_position":37,"commit_id":"dad939f4a2ce39efedb56cf2a66b3a57d0c104bf","original_commit_id":"dad939f4a2ce39efedb56cf2a66b3a57d0c104bf","user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"body":"Is this second describe needed? Looks to me the description could go into the first describe","created_at":"2016-07-26T21:43:30Z","updated_at":"2016-07-26T21:43:30Z","html_url":"https://github.com/angular/angular.js/pull/14850#discussion_r72343386","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/14850","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/72343386"},"html":{"href":"https://github.com/angular/angular.js/pull/14850#discussion_r72343386"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14850"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/14850","id":75786957,"html_url":"https://github.com/angular/angular.js/pull/14850","diff_url":"https://github.com/angular/angular.js/pull/14850.diff","patch_url":"https://github.com/angular/angular.js/pull/14850.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/14850","number":14850,"state":"open","locked":false,"title":"Optimize performance by optionally collectiong only EA directives","user":{"login":"drpicox","id":2758345,"avatar_url":"https://avatars.githubusercontent.com/u/2758345?v=3","gravatar_id":"","url":"https://api.github.com/users/drpicox","html_url":"https://github.com/drpicox","followers_url":"https://api.github.com/users/drpicox/followers","following_url":"https://api.github.com/users/drpicox/following{/other_user}","gists_url":"https://api.github.com/users/drpicox/gists{/gist_id}","starred_url":"https://api.github.com/users/drpicox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drpicox/subscriptions","organizations_url":"https://api.github.com/users/drpicox/orgs","repos_url":"https://api.github.com/users/drpicox/repos","events_url":"https://api.github.com/users/drpicox/events{/privacy}","received_events_url":"https://api.github.com/users/drpicox/received_events","type":"User","site_admin":false},"body":"**What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)** Performance optimization that introduces a new feature as `$compileProvider` configuration.\r\n\r\n\r\n\r\n**What is the current behavior? (You can also link to an open issue here)**: `$compile` collect directives from entities, attributes, classes and comments. It parses all four kind of directives, although usually only E (components) and A (\"directives\") are used in most of the projects.\r\n\r\n\r\n\r\n**What is the new behavior (if this is a feature change)?**: It introduces a new configuration in the `$compileProvider` that disables the compilation of C and M directives:\r\n\r\n```javascript\r\n$compileProvider.commentDirectivesEnabled(false);\r\n$compileProvider.cssClassDirectivesEnabled(false);\r\n```\r\n\r\n\r\n\r\n\r\n**Does this PR introduce a breaking change?**\r\nNo. By default is configured true, thus it is compatible with all existing code.\r\n\r\n\r\n**Please check if the PR fulfills these requirements**\r\n- [X] The commit message follows our guidelines: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format\r\n- [X] Tests for the changes have been added (for bug fixes / features)\r\n- [X] Docs have been added / updated (for bug fixes / features)\r\n\r\n**Other information**:\r\nIt is closely related to https://github.com/angular/angular.js/pull/14848 \r\nI have reused the same benchmarks to measure the improved performance of this PR, and it is around **10-15% of performance improvement** by setting restrictDirectivesTo to 'EA'.\r\n","created_at":"2016-06-30T09:28:17Z","updated_at":"2016-07-26T21:43:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b934feb64ec156830e44eefd8296382c4f53913","assignee":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"assignees":[{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/90","html_url":"https://github.com/angular/angular.js/milestones/1.5.x","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/90/labels","id":1025270,"number":90,"title":"1.5.x","description":"","creator":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"open_issues":102,"closed_issues":178,"state":"open","created_at":"2015-03-17T12:15:49Z","updated_at":"2016-07-26T07:29:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/14850/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/14850/comments","review_comment_url":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/14850/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/dad939f4a2ce39efedb56cf2a66b3a57d0c104bf","head":{"label":"drpicox:perf-collectDirectives-EA","ref":"perf-collectDirectives-EA","sha":"dad939f4a2ce39efedb56cf2a66b3a57d0c104bf","user":{"login":"drpicox","id":2758345,"avatar_url":"https://avatars.githubusercontent.com/u/2758345?v=3","gravatar_id":"","url":"https://api.github.com/users/drpicox","html_url":"https://github.com/drpicox","followers_url":"https://api.github.com/users/drpicox/followers","following_url":"https://api.github.com/users/drpicox/following{/other_user}","gists_url":"https://api.github.com/users/drpicox/gists{/gist_id}","starred_url":"https://api.github.com/users/drpicox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drpicox/subscriptions","organizations_url":"https://api.github.com/users/drpicox/orgs","repos_url":"https://api.github.com/users/drpicox/repos","events_url":"https://api.github.com/users/drpicox/events{/privacy}","received_events_url":"https://api.github.com/users/drpicox/received_events","type":"User","site_admin":false},"repo":{"id":49379600,"name":"angular.js","full_name":"drpicox/angular.js","owner":{"login":"drpicox","id":2758345,"avatar_url":"https://avatars.githubusercontent.com/u/2758345?v=3","gravatar_id":"","url":"https://api.github.com/users/drpicox","html_url":"https://github.com/drpicox","followers_url":"https://api.github.com/users/drpicox/followers","following_url":"https://api.github.com/users/drpicox/following{/other_user}","gists_url":"https://api.github.com/users/drpicox/gists{/gist_id}","starred_url":"https://api.github.com/users/drpicox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drpicox/subscriptions","organizations_url":"https://api.github.com/users/drpicox/orgs","repos_url":"https://api.github.com/users/drpicox/repos","events_url":"https://api.github.com/users/drpicox/events{/privacy}","received_events_url":"https://api.github.com/users/drpicox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drpicox/angular.js","description":"HTML enhanced for web apps","fork":true,"url":"https://api.github.com/repos/drpicox/angular.js","forks_url":"https://api.github.com/repos/drpicox/angular.js/forks","keys_url":"https://api.github.com/repos/drpicox/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drpicox/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drpicox/angular.js/teams","hooks_url":"https://api.github.com/repos/drpicox/angular.js/hooks","issue_events_url":"https://api.github.com/repos/drpicox/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/drpicox/angular.js/events","assignees_url":"https://api.github.com/repos/drpicox/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/drpicox/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/drpicox/angular.js/tags","blobs_url":"https://api.github.com/repos/drpicox/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drpicox/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drpicox/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/drpicox/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drpicox/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/drpicox/angular.js/languages","stargazers_url":"https://api.github.com/repos/drpicox/angular.js/stargazers","contributors_url":"https://api.github.com/repos/drpicox/angular.js/contributors","subscribers_url":"https://api.github.com/repos/drpicox/angular.js/subscribers","subscription_url":"https://api.github.com/repos/drpicox/angular.js/subscription","commits_url":"https://api.github.com/repos/drpicox/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/drpicox/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/drpicox/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/drpicox/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/drpicox/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/drpicox/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drpicox/angular.js/merges","archive_url":"https://api.github.com/repos/drpicox/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drpicox/angular.js/downloads","issues_url":"https://api.github.com/repos/drpicox/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/drpicox/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/drpicox/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/drpicox/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drpicox/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/drpicox/angular.js/releases{/id}","deployments_url":"https://api.github.com/repos/drpicox/angular.js/deployments","created_at":"2016-01-10T18:30:47Z","updated_at":"2016-07-22T08:36:40Z","pushed_at":"2016-07-22T08:36:09Z","git_url":"git://github.com/drpicox/angular.js.git","ssh_url":"git@github.com:drpicox/angular.js.git","clone_url":"https://github.com/drpicox/angular.js.git","svn_url":"https://github.com/drpicox/angular.js","homepage":"http://angularjs.org","size":78803,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"angular:master","ref":"master","sha":"83bc2479675fd1e0e023c5be1dbcbeb2e2932c6d","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":460078,"name":"angular.js","full_name":"angular/angular.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.js","description":"HTML enhanced for web apps","fork":false,"url":"https://api.github.com/repos/angular/angular.js","forks_url":"https://api.github.com/repos/angular/angular.js/forks","keys_url":"https://api.github.com/repos/angular/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.js/teams","hooks_url":"https://api.github.com/repos/angular/angular.js/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.js/events","assignees_url":"https://api.github.com/repos/angular/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.js/tags","blobs_url":"https://api.github.com/repos/angular/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.js/languages","stargazers_url":"https://api.github.com/repos/angular/angular.js/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.js/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.js/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.js/subscription","commits_url":"https://api.github.com/repos/angular/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.js/merges","archive_url":"https://api.github.com/repos/angular/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.js/downloads","issues_url":"https://api.github.com/repos/angular/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.js/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular.js/deployments","created_at":"2010-01-06T00:34:37Z","updated_at":"2016-07-26T21:19:57Z","pushed_at":"2016-07-26T19:59:28Z","git_url":"git://github.com/angular/angular.js.git","ssh_url":"git@github.com:angular/angular.js.git","clone_url":"https://github.com/angular/angular.js.git","svn_url":"https://github.com/angular/angular.js","homepage":"http://angularjs.org","size":177263,"stargazers_count":50929,"watchers_count":50929,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24807,"mirror_url":null,"open_issues_count":876,"forks":24807,"open_issues":876,"watchers":50929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14850"},"html":{"href":"https://github.com/angular/angular.js/pull/14850"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/14850"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/14850/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14850/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14850/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/dad939f4a2ce39efedb56cf2a66b3a57d0c104bf"}}}}
{"actor":{"display_login":"Narretz"}}