{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/35156479","id":35156479,"diff_hunk":"@@ -1626,6 +1626,37 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {\n     }\n \n     /**\n+     * A function generator that is used to support both eager and lazy compilation\n+     * linking function.\n+     * @param eager\n+     * @param $compileNodes\n+     * @param transcludeFn\n+     * @param maxPriority\n+     * @param ignoreDirective\n+     * @param previousCompileContext\n+     * @returns {Function}\n+     */\n+    function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {","path":"src/ng/compile.js","position":14,"original_position":14,"commit_id":"c9ff35cdefab5efc0c53038ef1b2f53620b21634","original_commit_id":"c9ff35cdefab5efc0c53038ef1b2f53620b21634","user":{"login":"lgalfaso","id":391394,"avatar_url":"https://avatars.githubusercontent.com/u/391394?v=3","gravatar_id":"","url":"https://api.github.com/users/lgalfaso","html_url":"https://github.com/lgalfaso","followers_url":"https://api.github.com/users/lgalfaso/followers","following_url":"https://api.github.com/users/lgalfaso/following{/other_user}","gists_url":"https://api.github.com/users/lgalfaso/gists{/gist_id}","starred_url":"https://api.github.com/users/lgalfaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgalfaso/subscriptions","organizations_url":"https://api.github.com/users/lgalfaso/orgs","repos_url":"https://api.github.com/users/lgalfaso/repos","events_url":"https://api.github.com/users/lgalfaso/events{/privacy}","received_events_url":"https://api.github.com/users/lgalfaso/received_events","type":"User","site_admin":false},"body":"SGTM","created_at":"2015-07-21T21:24:35Z","updated_at":"2015-07-21T21:24:35Z","html_url":"https://github.com/angular/angular.js/pull/12078#discussion_r35156479","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/12078","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/35156479"},"html":{"href":"https://github.com/angular/angular.js/pull/12078#discussion_r35156479"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/12078"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/12078","id":37389725,"html_url":"https://github.com/angular/angular.js/pull/12078","diff_url":"https://github.com/angular/angular.js/pull/12078.diff","patch_url":"https://github.com/angular/angular.js/pull/12078.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/12078","number":12078,"state":"open","locked":false,"title":"perf($compile): Lazily compile the `transclude` function","user":{"login":"dcherman","id":976608,"avatar_url":"https://avatars.githubusercontent.com/u/976608?v=3","gravatar_id":"","url":"https://api.github.com/users/dcherman","html_url":"https://github.com/dcherman","followers_url":"https://api.github.com/users/dcherman/followers","following_url":"https://api.github.com/users/dcherman/following{/other_user}","gists_url":"https://api.github.com/users/dcherman/gists{/gist_id}","starred_url":"https://api.github.com/users/dcherman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcherman/subscriptions","organizations_url":"https://api.github.com/users/dcherman/orgs","repos_url":"https://api.github.com/users/dcherman/repos","events_url":"https://api.github.com/users/dcherman/events{/privacy}","received_events_url":"https://api.github.com/users/dcherman/received_events","type":"User","site_admin":false},"body":"For transcluded directives, the transclude function can be lazily compiled\r\nmost of the time since the contents will not be needed until the\r\n`transclude` function was actually invoked.  For example, the `transclude`\r\nfunction that is passed to `ng-if` or `ng-switch-when` does not need to be\r\ninvoked until the condition that it's bound to has been matched.  For\r\ncomplex trees or switch statements, this can represent significant\r\nperformance gains since compilation of branches is deferred, and that\r\ncompilation may never actually happen if it isn't needed.\r\n\r\nIn a large application where I work that recently had some very complex `ngSwitch` cases added, this change significantly reduce the time spent in the compilation stage of the $digest cycle and further reduced the used JS heap size from **123MB** to **56.8MB**.\r\n\r\nThere are two instances where compilation will not be lazy; when we scan\r\nahead in the array of directives to be processed and find at least two of\r\nthe following:\r\n\r\n* A directive that is transcluded and does not allow multiple transclusion\r\n* A directive that has templateUrl and replace: true\r\n\r\nIn both of those cases, we will need to continue eager compilation in\r\norder to generate the multiple transclusion exception at the correct time.  If anyone has a better idea on how to support this while maintaining backwards compatibility with existing unit tests, I'm all ears. \r\n\r\nFixes #6072","created_at":"2015-06-10T18:35:47Z","updated_at":"2015-07-21T21:24:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8211fce7783df2d229ba1a8b2021f927e45fad7e","assignee":{"login":"lgalfaso","id":391394,"avatar_url":"https://avatars.githubusercontent.com/u/391394?v=3","gravatar_id":"","url":"https://api.github.com/users/lgalfaso","html_url":"https://github.com/lgalfaso","followers_url":"https://api.github.com/users/lgalfaso/followers","following_url":"https://api.github.com/users/lgalfaso/following{/other_user}","gists_url":"https://api.github.com/users/lgalfaso/gists{/gist_id}","starred_url":"https://api.github.com/users/lgalfaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgalfaso/subscriptions","organizations_url":"https://api.github.com/users/lgalfaso/orgs","repos_url":"https://api.github.com/users/lgalfaso/repos","events_url":"https://api.github.com/users/lgalfaso/events{/privacy}","received_events_url":"https://api.github.com/users/lgalfaso/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%20-%20migration-facilitation","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/90/labels","id":1025270,"number":90,"title":"1.5.x - migration-facilitation","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":27,"closed_issues":6,"state":"open","created_at":"2015-03-17T12:15:49Z","updated_at":"2015-07-18T09:21:14Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/12078/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/12078/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/12078/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/c9ff35cdefab5efc0c53038ef1b2f53620b21634","head":{"label":"dcherman:lazy_compile","ref":"lazy_compile","sha":"c9ff35cdefab5efc0c53038ef1b2f53620b21634","user":{"login":"dcherman","id":976608,"avatar_url":"https://avatars.githubusercontent.com/u/976608?v=3","gravatar_id":"","url":"https://api.github.com/users/dcherman","html_url":"https://github.com/dcherman","followers_url":"https://api.github.com/users/dcherman/followers","following_url":"https://api.github.com/users/dcherman/following{/other_user}","gists_url":"https://api.github.com/users/dcherman/gists{/gist_id}","starred_url":"https://api.github.com/users/dcherman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcherman/subscriptions","organizations_url":"https://api.github.com/users/dcherman/orgs","repos_url":"https://api.github.com/users/dcherman/repos","events_url":"https://api.github.com/users/dcherman/events{/privacy}","received_events_url":"https://api.github.com/users/dcherman/received_events","type":"User","site_admin":false},"repo":{"id":10613813,"name":"angular.js","full_name":"dcherman/angular.js","owner":{"login":"dcherman","id":976608,"avatar_url":"https://avatars.githubusercontent.com/u/976608?v=3","gravatar_id":"","url":"https://api.github.com/users/dcherman","html_url":"https://github.com/dcherman","followers_url":"https://api.github.com/users/dcherman/followers","following_url":"https://api.github.com/users/dcherman/following{/other_user}","gists_url":"https://api.github.com/users/dcherman/gists{/gist_id}","starred_url":"https://api.github.com/users/dcherman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcherman/subscriptions","organizations_url":"https://api.github.com/users/dcherman/orgs","repos_url":"https://api.github.com/users/dcherman/repos","events_url":"https://api.github.com/users/dcherman/events{/privacy}","received_events_url":"https://api.github.com/users/dcherman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcherman/angular.js","description":"","fork":true,"url":"https://api.github.com/repos/dcherman/angular.js","forks_url":"https://api.github.com/repos/dcherman/angular.js/forks","keys_url":"https://api.github.com/repos/dcherman/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcherman/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcherman/angular.js/teams","hooks_url":"https://api.github.com/repos/dcherman/angular.js/hooks","issue_events_url":"https://api.github.com/repos/dcherman/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/dcherman/angular.js/events","assignees_url":"https://api.github.com/repos/dcherman/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/dcherman/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/dcherman/angular.js/tags","blobs_url":"https://api.github.com/repos/dcherman/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcherman/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcherman/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcherman/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcherman/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/dcherman/angular.js/languages","stargazers_url":"https://api.github.com/repos/dcherman/angular.js/stargazers","contributors_url":"https://api.github.com/repos/dcherman/angular.js/contributors","subscribers_url":"https://api.github.com/repos/dcherman/angular.js/subscribers","subscription_url":"https://api.github.com/repos/dcherman/angular.js/subscription","commits_url":"https://api.github.com/repos/dcherman/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcherman/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcherman/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcherman/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcherman/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/dcherman/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcherman/angular.js/merges","archive_url":"https://api.github.com/repos/dcherman/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcherman/angular.js/downloads","issues_url":"https://api.github.com/repos/dcherman/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/dcherman/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/dcherman/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/dcherman/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcherman/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/dcherman/angular.js/releases{/id}","created_at":"2013-06-11T02:55:35Z","updated_at":"2015-06-09T21:22:46Z","pushed_at":"2015-07-20T06:08:01Z","git_url":"git://github.com/dcherman/angular.js.git","ssh_url":"git@github.com:dcherman/angular.js.git","clone_url":"https://github.com/dcherman/angular.js.git","svn_url":"https://github.com/dcherman/angular.js","homepage":"http://angularjs.org","size":65611,"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":"cce084ee89bfbdc184993ec96aed936372c2d4c9","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}","created_at":"2010-01-06T00:34:37Z","updated_at":"2015-07-21T20:00:26Z","pushed_at":"2015-07-21T20:55:26Z","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":240933,"stargazers_count":40872,"watchers_count":40872,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17761,"mirror_url":null,"open_issues_count":1249,"forks":17761,"open_issues":1249,"watchers":40872,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/12078"},"html":{"href":"https://github.com/angular/angular.js/pull/12078"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/12078"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/12078/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/12078/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/12078/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/c9ff35cdefab5efc0c53038ef1b2f53620b21634"}}}}