{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/comments/110523997","pull_request_review_id":31706754,"id":110523997,"diff_hunk":"@@ -552,9 +572,22 @@ public void Flush()\n             Output.Flush();\n         }\n \n-        public async Task FlushAsync(CancellationToken cancellationToken)\n+        public Task FlushAsync(CancellationToken cancellationToken)\n         {\n-            await InitializeResponse(0);\n+            var initializeTask = InitializeResponseMayAwait(0);\n+            // If return is TaskCache.CompletedTask no awaiting is required\n+            if (!ReferenceEquals(initializeTask, TaskCache.CompletedTask))\n+            {\n+                return FlushAsyncAwaited(initializeTask, cancellationToken);\n+            }\n+\n+            return Output.FlushAsync(cancellationToken);\n+        }\n+\n+        [MethodImpl(MethodImplOptions.NoInlining)]","path":"src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.cs","position":113,"original_position":113,"commit_id":"bc59394ea2e4bc700725313372877271e05226fe","original_commit_id":"bc59394ea2e4bc700725313372877271e05226fe","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars2.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"The `MoveNext()` method is 275 bytes of il so wouldn't be inlined; but the init `FlushAsyncAwaited` call is 73 bytes of il so it is possible... (though unlikely)","created_at":"2017-04-08T18:08:49Z","updated_at":"2017-04-08T18:08:50Z","html_url":"https://github.com/aspnet/KestrelHttpServer/pull/1635#discussion_r110523997","pull_request_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635","_links":{"self":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/comments/110523997"},"html":{"href":"https://github.com/aspnet/KestrelHttpServer/pull/1635#discussion_r110523997"},"pull_request":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635","id":114930915,"html_url":"https://github.com/aspnet/KestrelHttpServer/pull/1635","diff_url":"https://github.com/aspnet/KestrelHttpServer/pull/1635.diff","patch_url":"https://github.com/aspnet/KestrelHttpServer/pull/1635.patch","issue_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1635","number":1635,"state":"open","locked":false,"title":"Less async","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars2.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"If there aren't any `_onStarting` events; generally the whole startup can bypass the `async`.\r\n\r\nUsing `ReferenceEquals` on `TaskCache.CompletedTask` rather than doing the bit manipulations that Task does to work out if it has completed sync, as is simpler. \r\n\r\nBetter bits from https://github.com/aspnet/KestrelHttpServer/pull/1477","created_at":"2017-04-08T04:21:22Z","updated_at":"2017-04-08T18:08:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b149ec2064609ea2ba5c14772afc2c4b2a9ccd44","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635/commits","review_comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635/comments","review_comment_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1635/comments","statuses_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/statuses/bc59394ea2e4bc700725313372877271e05226fe","head":{"label":"benaadams:less-async","ref":"less-async","sha":"bc59394ea2e4bc700725313372877271e05226fe","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars2.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"repo":{"id":38999457,"name":"KestrelHttpServer","full_name":"benaadams/KestrelHttpServer","owner":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars2.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benaadams/KestrelHttpServer","description":"A development web server for ASP.NET vNext based on libuv.","fork":true,"url":"https://api.github.com/repos/benaadams/KestrelHttpServer","forks_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/forks","keys_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/teams","hooks_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/hooks","issue_events_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/issues/events{/number}","events_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/events","assignees_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/assignees{/user}","branches_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/branches{/branch}","tags_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/tags","blobs_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/statuses/{sha}","languages_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/languages","stargazers_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/stargazers","contributors_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/contributors","subscribers_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/subscribers","subscription_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/subscription","commits_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/contents/{+path}","compare_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/merges","archive_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/downloads","issues_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/issues{/number}","pulls_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/pulls{/number}","milestones_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/milestones{/number}","notifications_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/labels{/name}","releases_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/releases{/id}","deployments_url":"https://api.github.com/repos/benaadams/KestrelHttpServer/deployments","created_at":"2015-07-13T08:10:06Z","updated_at":"2016-11-22T08:31:35Z","pushed_at":"2017-04-08T08:26:58Z","git_url":"git://github.com/benaadams/KestrelHttpServer.git","ssh_url":"git@github.com:benaadams/KestrelHttpServer.git","clone_url":"https://github.com/benaadams/KestrelHttpServer.git","svn_url":"https://github.com/benaadams/KestrelHttpServer","homepage":"","size":4862,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"27584dc62000c6b545c321a5d93705d1d4f26a43","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars0.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":20344662,"name":"KestrelHttpServer","full_name":"aspnet/KestrelHttpServer","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars0.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/KestrelHttpServer","description":"A web server for ASP.NET Core based on libuv.","fork":false,"url":"https://api.github.com/repos/aspnet/KestrelHttpServer","forks_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/forks","keys_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/teams","hooks_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/hooks","issue_events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/events","assignees_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/tags","blobs_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/languages","stargazers_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/stargazers","contributors_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/contributors","subscribers_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/subscribers","subscription_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/subscription","commits_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/merges","archive_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/downloads","issues_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/deployments","created_at":"2014-05-30T22:46:28Z","updated_at":"2017-04-08T14:48:56Z","pushed_at":"2017-04-08T09:05:57Z","git_url":"git://github.com/aspnet/KestrelHttpServer.git","ssh_url":"git@github.com:aspnet/KestrelHttpServer.git","clone_url":"https://github.com/aspnet/KestrelHttpServer.git","svn_url":"https://github.com/aspnet/KestrelHttpServer","homepage":"","size":5210,"stargazers_count":1506,"watchers_count":1506,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":310,"mirror_url":null,"open_issues_count":92,"forks":310,"open_issues":92,"watchers":1506,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635"},"html":{"href":"https://github.com/aspnet/KestrelHttpServer/pull/1635"},"issue":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1635"},"comments":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1635/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/pulls/1635/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/KestrelHttpServer/statuses/bc59394ea2e4bc700725313372877271e05226fe"}}}}
{"actor":{"display_login":"benaadams"}}