{"action":"created","comment":{"url":"https://api.github.com/repos/iojs/io.js/pulls/comments/24295131","id":24295131,"diff_hunk":"@@ -487,7 +492,7 @@ OutgoingMessage.prototype.end = function(data, encoding, callback) {\n     encoding = null;\n   }\n \n-  if (data && typeof data !== 'string' && !(data instanceof Buffer)) {\n+  if (data && !(typeof data === 'string' || data instanceof Buffer)) {","path":"lib/_http_outgoing.js","position":104,"original_position":104,"commit_id":"5ff7d4f8203e78cf7feb9f98fc9ebfd47ac9177d","original_commit_id":"f763504aeccf39c0d37fc9dcb8485ad7801ca8fb","user":{"login":"bnoordhuis","id":275871,"avatar_url":"https://avatars.githubusercontent.com/u/275871?v=3","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"body":"I'm not sure if it's worth optimizing for the uncommon case ('bug case' really) but I'll leave that at your discretion.  I do think it's a little harder to read now, though.","created_at":"2015-02-08T02:45:18Z","updated_at":"2015-02-08T02:45:18Z","html_url":"https://github.com/iojs/io.js/pull/605#discussion_r24295131","pull_request_url":"https://api.github.com/repos/iojs/io.js/pulls/605","_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/comments/24295131"},"html":{"href":"https://github.com/iojs/io.js/pull/605#discussion_r24295131"},"pull_request":{"href":"https://api.github.com/repos/iojs/io.js/pulls/605"}}},"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/605","id":28002352,"html_url":"https://github.com/iojs/io.js/pull/605","diff_url":"https://github.com/iojs/io.js/pull/605.diff","patch_url":"https://github.com/iojs/io.js/pull/605.patch","issue_url":"https://api.github.com/repos/iojs/io.js/issues/605","number":605,"state":"open","locked":false,"title":"http: optimize outgoing requests","user":{"login":"brendanashworth","id":3038254,"avatar_url":"https://avatars.githubusercontent.com/u/3038254?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanashworth","html_url":"https://github.com/brendanashworth","followers_url":"https://api.github.com/users/brendanashworth/followers","following_url":"https://api.github.com/users/brendanashworth/following{/other_user}","gists_url":"https://api.github.com/users/brendanashworth/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanashworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanashworth/subscriptions","organizations_url":"https://api.github.com/users/brendanashworth/orgs","repos_url":"https://api.github.com/users/brendanashworth/repos","events_url":"https://api.github.com/users/brendanashworth/events{/privacy}","received_events_url":"https://api.github.com/users/brendanashworth/received_events","type":"User","site_admin":false},"body":"This commit does some small optimization changes on\r\n`lib/_http_outgoing.js`. These include switching from `while` loops to\r\n`for` loops, moving away from `util` to `typeof` checks, and removing\r\ndead code.\r\n\r\n[Here is a graph](https://plot.ly/14/~brendanashworth/) of the benchmark\r\nchange (duration = 20, ran twice each). Changes aren't very visible in\r\nsmaller packets - at 32 bytes, only about 1% more requests can be sent,\r\nbut it increases as the packets increase in size; 1024 has 4.7% more\r\nthroughput than before.\r\n\r\n[Here is a graph](https://plot.ly/19/~brendanashworth) of the same\r\nbenchmark but sorted by encoding type. As it is shown, buffers get the\r\nbiggest speed increase, then utf-8, then ASCII.","created_at":"2015-01-26T01:56:41Z","updated_at":"2015-02-08T02:45:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6afc69e16b9f8a66f7ce09c36d51edd852d58399","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iojs/io.js/pulls/605/commits","review_comments_url":"https://api.github.com/repos/iojs/io.js/pulls/605/comments","review_comment_url":"https://api.github.com/repos/iojs/io.js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/605/comments","statuses_url":"https://api.github.com/repos/iojs/io.js/statuses/5ff7d4f8203e78cf7feb9f98fc9ebfd47ac9177d","head":{"label":"brendanashworth:optimize-http-outgoing","ref":"optimize-http-outgoing","sha":"5ff7d4f8203e78cf7feb9f98fc9ebfd47ac9177d","user":{"login":"brendanashworth","id":3038254,"avatar_url":"https://avatars.githubusercontent.com/u/3038254?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanashworth","html_url":"https://github.com/brendanashworth","followers_url":"https://api.github.com/users/brendanashworth/followers","following_url":"https://api.github.com/users/brendanashworth/following{/other_user}","gists_url":"https://api.github.com/users/brendanashworth/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanashworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanashworth/subscriptions","organizations_url":"https://api.github.com/users/brendanashworth/orgs","repos_url":"https://api.github.com/users/brendanashworth/repos","events_url":"https://api.github.com/users/brendanashworth/events{/privacy}","received_events_url":"https://api.github.com/users/brendanashworth/received_events","type":"User","site_admin":false},"repo":{"id":27578495,"name":"io.js","full_name":"brendanashworth/io.js","owner":{"login":"brendanashworth","id":3038254,"avatar_url":"https://avatars.githubusercontent.com/u/3038254?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanashworth","html_url":"https://github.com/brendanashworth","followers_url":"https://api.github.com/users/brendanashworth/followers","following_url":"https://api.github.com/users/brendanashworth/following{/other_user}","gists_url":"https://api.github.com/users/brendanashworth/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanashworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanashworth/subscriptions","organizations_url":"https://api.github.com/users/brendanashworth/orgs","repos_url":"https://api.github.com/users/brendanashworth/repos","events_url":"https://api.github.com/users/brendanashworth/events{/privacy}","received_events_url":"https://api.github.com/users/brendanashworth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brendanashworth/io.js","description":"Evented IO for V8 JavaScript","fork":true,"url":"https://api.github.com/repos/brendanashworth/io.js","forks_url":"https://api.github.com/repos/brendanashworth/io.js/forks","keys_url":"https://api.github.com/repos/brendanashworth/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brendanashworth/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brendanashworth/io.js/teams","hooks_url":"https://api.github.com/repos/brendanashworth/io.js/hooks","issue_events_url":"https://api.github.com/repos/brendanashworth/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/brendanashworth/io.js/events","assignees_url":"https://api.github.com/repos/brendanashworth/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/brendanashworth/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/brendanashworth/io.js/tags","blobs_url":"https://api.github.com/repos/brendanashworth/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brendanashworth/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brendanashworth/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/brendanashworth/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brendanashworth/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/brendanashworth/io.js/languages","stargazers_url":"https://api.github.com/repos/brendanashworth/io.js/stargazers","contributors_url":"https://api.github.com/repos/brendanashworth/io.js/contributors","subscribers_url":"https://api.github.com/repos/brendanashworth/io.js/subscribers","subscription_url":"https://api.github.com/repos/brendanashworth/io.js/subscription","commits_url":"https://api.github.com/repos/brendanashworth/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/brendanashworth/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/brendanashworth/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/brendanashworth/io.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/brendanashworth/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/brendanashworth/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brendanashworth/io.js/merges","archive_url":"https://api.github.com/repos/brendanashworth/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brendanashworth/io.js/downloads","issues_url":"https://api.github.com/repos/brendanashworth/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/brendanashworth/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/brendanashworth/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/brendanashworth/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brendanashworth/io.js/labels{/name}","releases_url":"https://api.github.com/repos/brendanashworth/io.js/releases{/id}","created_at":"2014-12-05T06:43:32Z","updated_at":"2015-01-30T02:57:49Z","pushed_at":"2015-02-07T19:50:41Z","git_url":"git://github.com/brendanashworth/io.js.git","ssh_url":"git@github.com:brendanashworth/io.js.git","clone_url":"https://github.com/brendanashworth/io.js.git","svn_url":"https://github.com/brendanashworth/io.js","homepage":null,"size":119046,"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":"v1.x"}},"base":{"label":"iojs:v1.x","ref":"v1.x","sha":"b9d3928f80992a812795a974cbae02288fc5049c","user":{"login":"iojs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/iojs","html_url":"https://github.com/iojs","followers_url":"https://api.github.com/users/iojs/followers","following_url":"https://api.github.com/users/iojs/following{/other_user}","gists_url":"https://api.github.com/users/iojs/gists{/gist_id}","starred_url":"https://api.github.com/users/iojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iojs/subscriptions","organizations_url":"https://api.github.com/users/iojs/orgs","repos_url":"https://api.github.com/users/iojs/repos","events_url":"https://api.github.com/users/iojs/events{/privacy}","received_events_url":"https://api.github.com/users/iojs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"io.js","full_name":"iojs/io.js","owner":{"login":"iojs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/iojs","html_url":"https://github.com/iojs","followers_url":"https://api.github.com/users/iojs/followers","following_url":"https://api.github.com/users/iojs/following{/other_user}","gists_url":"https://api.github.com/users/iojs/gists{/gist_id}","starred_url":"https://api.github.com/users/iojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iojs/subscriptions","organizations_url":"https://api.github.com/users/iojs/orgs","repos_url":"https://api.github.com/users/iojs/repos","events_url":"https://api.github.com/users/iojs/events{/privacy}","received_events_url":"https://api.github.com/users/iojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iojs/io.js","description":"A friendly fork of Node.js with an open governance model","fork":false,"url":"https://api.github.com/repos/iojs/io.js","forks_url":"https://api.github.com/repos/iojs/io.js/forks","keys_url":"https://api.github.com/repos/iojs/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iojs/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iojs/io.js/teams","hooks_url":"https://api.github.com/repos/iojs/io.js/hooks","issue_events_url":"https://api.github.com/repos/iojs/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/iojs/io.js/events","assignees_url":"https://api.github.com/repos/iojs/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/iojs/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/iojs/io.js/tags","blobs_url":"https://api.github.com/repos/iojs/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iojs/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iojs/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/iojs/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iojs/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/iojs/io.js/languages","stargazers_url":"https://api.github.com/repos/iojs/io.js/stargazers","contributors_url":"https://api.github.com/repos/iojs/io.js/contributors","subscribers_url":"https://api.github.com/repos/iojs/io.js/subscribers","subscription_url":"https://api.github.com/repos/iojs/io.js/subscription","commits_url":"https://api.github.com/repos/iojs/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/iojs/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/iojs/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/iojs/io.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/iojs/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/iojs/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iojs/io.js/merges","archive_url":"https://api.github.com/repos/iojs/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iojs/io.js/downloads","issues_url":"https://api.github.com/repos/iojs/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/iojs/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/iojs/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/iojs/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iojs/io.js/labels{/name}","releases_url":"https://api.github.com/repos/iojs/io.js/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-02-08T02:38:39Z","pushed_at":"2015-02-07T22:11:26Z","git_url":"git://github.com/iojs/io.js.git","ssh_url":"git@github.com:iojs/io.js.git","clone_url":"https://github.com/iojs/io.js.git","svn_url":"https://github.com/iojs/io.js","homepage":"https://iojs.org","size":143685,"stargazers_count":9677,"watchers_count":9677,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":580,"mirror_url":null,"open_issues_count":131,"forks":580,"open_issues":131,"watchers":9677,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/605"},"html":{"href":"https://github.com/iojs/io.js/pull/605"},"issue":{"href":"https://api.github.com/repos/iojs/io.js/issues/605"},"comments":{"href":"https://api.github.com/repos/iojs/io.js/issues/605/comments"},"review_comments":{"href":"https://api.github.com/repos/iojs/io.js/pulls/605/comments"},"review_comment":{"href":"https://api.github.com/repos/iojs/io.js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/iojs/io.js/pulls/605/commits"},"statuses":{"href":"https://api.github.com/repos/iojs/io.js/statuses/5ff7d4f8203e78cf7feb9f98fc9ebfd47ac9177d"}}}}