{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/23051124","id":23051124,"diff_hunk":"@@ -1,29 +1,14 @@\n define(function(require, exports, module) {\n 'use strict';\n \n-var NEXT_TICK = 'calendar-next-tick';\n-\n-var nextTickStack = [];\n+var resolved = Promise.resolve();\n \n /**\n  * Very similar to node's nextTick.\n- * Much faster then setTimeout.\n+ * Much faster than setTimeout or window.postMessage\n  */\n module.exports = function(callback) {\n-  nextTickStack.push(callback);\n-  window.postMessage(NEXT_TICK, '*');\n+  resolved.then(callback);","path":"apps/calendar/js/next_tick.js","position":17,"original_position":17,"commit_id":"78d6baa51dfc1b7fc633b4e71aeac6c21e737b48","original_commit_id":"78d6baa51dfc1b7fc633b4e71aeac6c21e737b48","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"body":"100% sure, it's over 100x faster: http://jsperf.com/test002/8 - I even talked to dbaron about it and also created a blog post: http://blog.millermedeiros.com/promise-nexttick/\r\n\r\nthis change improved the startup perf in ~80ms.","created_at":"2015-01-15T22:53:59Z","updated_at":"2015-01-15T22:53:59Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/27388#discussion_r23051124","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/23051124"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/27388#discussion_r23051124"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388","id":27363199,"html_url":"https://github.com/mozilla-b2g/gaia/pull/27388","diff_url":"https://github.com/mozilla-b2g/gaia/pull/27388.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/27388.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27388","number":27388,"state":"open","locked":false,"title":"Bug 1079557 - [Calendar] launch time improvement r=gaye","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"body":"got `content-interactive` from ~1850ms to ~1180ms\r\n\r\n - bundled CSS/JS;\r\n - changed the initialization order;\r\n - replaced the module loader from alameda to curl.js; (there is something weird with our dependency tree that slows down alameda..)\r\n - simplified some methods;\r\n - reduced/batched reflows;\r\n - faster `nextTick` implementation by using native `Promise` instead of `postMessage`;","created_at":"2015-01-14T16:38:19Z","updated_at":"2015-01-15T22:53:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f32a6e33cde01b46fad1a95000c8b637ad49fea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27388/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/78d6baa51dfc1b7fc633b4e71aeac6c21e737b48","head":{"label":"millermedeiros:1079557-startup-perf","ref":"1079557-startup-perf","sha":"78d6baa51dfc1b7fc633b4e71aeac6c21e737b48","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"repo":{"id":15678349,"name":"gaia","full_name":"millermedeiros/gaia","owner":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/millermedeiros/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/millermedeiros/gaia","forks_url":"https://api.github.com/repos/millermedeiros/gaia/forks","keys_url":"https://api.github.com/repos/millermedeiros/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/millermedeiros/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/millermedeiros/gaia/teams","hooks_url":"https://api.github.com/repos/millermedeiros/gaia/hooks","issue_events_url":"https://api.github.com/repos/millermedeiros/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/millermedeiros/gaia/events","assignees_url":"https://api.github.com/repos/millermedeiros/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/millermedeiros/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/millermedeiros/gaia/tags","blobs_url":"https://api.github.com/repos/millermedeiros/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/millermedeiros/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/millermedeiros/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/millermedeiros/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/millermedeiros/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/millermedeiros/gaia/languages","stargazers_url":"https://api.github.com/repos/millermedeiros/gaia/stargazers","contributors_url":"https://api.github.com/repos/millermedeiros/gaia/contributors","subscribers_url":"https://api.github.com/repos/millermedeiros/gaia/subscribers","subscription_url":"https://api.github.com/repos/millermedeiros/gaia/subscription","commits_url":"https://api.github.com/repos/millermedeiros/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/millermedeiros/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/millermedeiros/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/millermedeiros/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/millermedeiros/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/millermedeiros/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/millermedeiros/gaia/merges","archive_url":"https://api.github.com/repos/millermedeiros/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/millermedeiros/gaia/downloads","issues_url":"https://api.github.com/repos/millermedeiros/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/millermedeiros/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/millermedeiros/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/millermedeiros/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/millermedeiros/gaia/labels{/name}","releases_url":"https://api.github.com/repos/millermedeiros/gaia/releases{/id}","created_at":"2014-01-06T16:05:19Z","updated_at":"2014-07-18T00:24:12Z","pushed_at":"2015-01-15T17:43:44Z","git_url":"git://github.com/millermedeiros/gaia.git","ssh_url":"git@github.com:millermedeiros/gaia.git","clone_url":"https://github.com/millermedeiros/gaia.git","svn_url":"https://github.com/millermedeiros/gaia","homepage":"https://wiki.mozilla.org/B2G","size":860716,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mozilla-b2g:master","ref":"master","sha":"bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-01-15T21:52:46Z","pushed_at":"2015-01-15T21:52:46Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1378751,"stargazers_count":1853,"watchers_count":1853,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2160,"mirror_url":null,"open_issues_count":831,"forks":2160,"open_issues":831,"watchers":1853,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/27388"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27388"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27388/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27388/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/78d6baa51dfc1b7fc633b4e71aeac6c21e737b48"}}}}