{"action":"created","comment":{"url":"https://api.github.com/repos/iojs/io.js/pulls/comments/25778278","id":25778278,"diff_hunk":"@@ -413,16 +413,9 @@ function spliceOne(list, index) {\n   list.pop();\n }\n \n-function arrayClone(arr, len) {\n-  var ret;\n-  if (len === undefined)\n-    len = arr.length;\n-  if (len >= 50)\n-    ret = arr.slice();\n-  else {\n-    ret = new Array(len);\n-    for (var i = 0; i < len; i += 1)\n-      ret[i] = arr[i];\n-  }\n-  return ret;\n+function arrayClone(arr, i) {\n+  var copy = new Array(i);\n+  while (i--)","path":"lib/events.js","position":27,"original_position":27,"commit_id":"b58a7d5053ba1c7d2917ed01c1424ae5b0cfba87","original_commit_id":"b58a7d5053ba1c7d2917ed01c1424ae5b0cfba87","user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"body":"According to [this jsperf](http://jsperf.com/copy-loop-vs-array-slice/34) and [this jsperf](http://jsperf.com/copy-loop-vs-array-slice/33) it appears so, at least in this case.","created_at":"2015-03-04T14:36:26Z","updated_at":"2015-03-04T14:36:26Z","html_url":"https://github.com/iojs/io.js/pull/1050#discussion_r25778278","pull_request_url":"https://api.github.com/repos/iojs/io.js/pulls/1050","_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/comments/25778278"},"html":{"href":"https://github.com/iojs/io.js/pull/1050#discussion_r25778278"},"pull_request":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1050"}}},"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/1050","id":30440936,"html_url":"https://github.com/iojs/io.js/pull/1050","diff_url":"https://github.com/iojs/io.js/pull/1050.diff","patch_url":"https://github.com/iojs/io.js/pull/1050.patch","issue_url":"https://api.github.com/repos/iojs/io.js/issues/1050","number":1050,"state":"open","locked":false,"title":"events: optimize listener array cloning","user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"body":"This both switches to a single algorithm for array cloning and also\r\nspeeds up (by ~100% in the ee-listeners-many benchmark) the\r\n\"many elements\"  case that was previously handled by\r\n`array.slice()`.","created_at":"2015-03-04T06:14:18Z","updated_at":"2015-03-04T14:36:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aee29bbcaaa8974fbae25135994e77e1062583f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iojs/io.js/pulls/1050/commits","review_comments_url":"https://api.github.com/repos/iojs/io.js/pulls/1050/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/1050/comments","statuses_url":"https://api.github.com/repos/iojs/io.js/statuses/b58a7d5053ba1c7d2917ed01c1424ae5b0cfba87","head":{"label":"mscdex:perf-events-part4","ref":"perf-events-part4","sha":"b58a7d5053ba1c7d2917ed01c1424ae5b0cfba87","user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"repo":{"id":29220048,"name":"io.js","full_name":"mscdex/io.js","owner":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mscdex/io.js","description":"A spork of Node.js with an open governance model","fork":true,"url":"https://api.github.com/repos/mscdex/io.js","forks_url":"https://api.github.com/repos/mscdex/io.js/forks","keys_url":"https://api.github.com/repos/mscdex/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mscdex/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mscdex/io.js/teams","hooks_url":"https://api.github.com/repos/mscdex/io.js/hooks","issue_events_url":"https://api.github.com/repos/mscdex/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/mscdex/io.js/events","assignees_url":"https://api.github.com/repos/mscdex/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/mscdex/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/mscdex/io.js/tags","blobs_url":"https://api.github.com/repos/mscdex/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mscdex/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mscdex/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mscdex/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mscdex/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mscdex/io.js/languages","stargazers_url":"https://api.github.com/repos/mscdex/io.js/stargazers","contributors_url":"https://api.github.com/repos/mscdex/io.js/contributors","subscribers_url":"https://api.github.com/repos/mscdex/io.js/subscribers","subscription_url":"https://api.github.com/repos/mscdex/io.js/subscription","commits_url":"https://api.github.com/repos/mscdex/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mscdex/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mscdex/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mscdex/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mscdex/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/mscdex/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mscdex/io.js/merges","archive_url":"https://api.github.com/repos/mscdex/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mscdex/io.js/downloads","issues_url":"https://api.github.com/repos/mscdex/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/mscdex/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mscdex/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mscdex/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mscdex/io.js/labels{/name}","releases_url":"https://api.github.com/repos/mscdex/io.js/releases{/id}","created_at":"2015-01-14T01:01:23Z","updated_at":"2015-01-14T01:01:26Z","pushed_at":"2015-03-04T06:13:48Z","git_url":"git://github.com/mscdex/io.js.git","ssh_url":"git@github.com:mscdex/io.js.git","clone_url":"https://github.com/mscdex/io.js.git","svn_url":"https://github.com/mscdex/io.js","homepage":"","size":120299,"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":"08133f45c73cbae241881979dd41d0d63b4f84a0","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-03-04T14:27:06Z","pushed_at":"2015-03-04T11:17:36Z","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":153640,"stargazers_count":10839,"watchers_count":10839,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":688,"mirror_url":null,"open_issues_count":198,"forks":688,"open_issues":198,"watchers":10839,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1050"},"html":{"href":"https://github.com/iojs/io.js/pull/1050"},"issue":{"href":"https://api.github.com/repos/iojs/io.js/issues/1050"},"comments":{"href":"https://api.github.com/repos/iojs/io.js/issues/1050/comments"},"review_comments":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1050/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/1050/commits"},"statuses":{"href":"https://api.github.com/repos/iojs/io.js/statuses/b58a7d5053ba1c7d2917ed01c1424ae5b0cfba87"}}}}