{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/605","labels_url":"https://api.github.com/repos/iojs/io.js/issues/605/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/605/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/605/events","html_url":"https://github.com/iojs/io.js/pull/605","id":55439821,"number":605,"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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-26T01:56:41Z","updated_at":"2015-01-27T06:28:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/605","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"},"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."},"comment":{"url":"https://api.github.com/repos/iojs/io.js/issues/comments/71596083","html_url":"https://github.com/iojs/io.js/pull/605#issuecomment-71596083","issue_url":"https://api.github.com/repos/iojs/io.js/issues/605","id":71596083,"user":{"login":"yaycmyk","id":570070,"avatar_url":"https://avatars.githubusercontent.com/u/570070?v=3","gravatar_id":"","url":"https://api.github.com/users/yaycmyk","html_url":"https://github.com/yaycmyk","followers_url":"https://api.github.com/users/yaycmyk/followers","following_url":"https://api.github.com/users/yaycmyk/following{/other_user}","gists_url":"https://api.github.com/users/yaycmyk/gists{/gist_id}","starred_url":"https://api.github.com/users/yaycmyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaycmyk/subscriptions","organizations_url":"https://api.github.com/users/yaycmyk/orgs","repos_url":"https://api.github.com/users/yaycmyk/repos","events_url":"https://api.github.com/users/yaycmyk/events{/privacy}","received_events_url":"https://api.github.com/users/yaycmyk/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T06:28:23Z","updated_at":"2015-01-27T06:28:23Z","body":"@mscdex Sure, but it's more being courteous to the next developer than a general coding problem. Legibility > brevity IMO -- declaring everything at the onset gives you a quick birds' eye view of your function and makes it easier to grok what the important bits of data are."}}