{"action":"created","comment":{"url":"https://api.github.com/repos/felixge/node-mysql/pulls/comments/27940032","id":27940032,"diff_hunk":"@@ -66,16 +66,16 @@ SqlString.arrayToList = function(array, timeZone) {\n \n SqlString.format = function(sql, values, stringifyObjects, timeZone) {\n   values = values == null ? [] : [].concat(values);","path":"lib/protocol/SqlString.js","position":3,"original_position":3,"commit_id":"187cfa1edccaa1c7c7ce600c05028813c970b8f9","original_commit_id":"187cfa1edccaa1c7c7ce600c05028813c970b8f9","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"body":"No need for array copying, as you're not modifying it anymore. More win :)","created_at":"2015-04-08T03:18:54Z","updated_at":"2015-04-08T03:18:54Z","html_url":"https://github.com/felixge/node-mysql/pull/1019#discussion_r27940032","pull_request_url":"https://api.github.com/repos/felixge/node-mysql/pulls/1019","_links":{"self":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/comments/27940032"},"html":{"href":"https://github.com/felixge/node-mysql/pull/1019#discussion_r27940032"},"pull_request":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/1019"}}},"pull_request":{"url":"https://api.github.com/repos/felixge/node-mysql/pulls/1019","id":30192253,"html_url":"https://github.com/felixge/node-mysql/pull/1019","diff_url":"https://github.com/felixge/node-mysql/pull/1019.diff","patch_url":"https://github.com/felixge/node-mysql/pull/1019.patch","issue_url":"https://api.github.com/repos/felixge/node-mysql/issues/1019","number":1019,"state":"closed","locked":false,"title":"Optimize SqlString.format","user":{"login":"jonapgar","id":4521221,"avatar_url":"https://avatars.githubusercontent.com/u/4521221?v=3","gravatar_id":"","url":"https://api.github.com/users/jonapgar","html_url":"https://github.com/jonapgar","followers_url":"https://api.github.com/users/jonapgar/followers","following_url":"https://api.github.com/users/jonapgar/following{/other_user}","gists_url":"https://api.github.com/users/jonapgar/gists{/gist_id}","starred_url":"https://api.github.com/users/jonapgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonapgar/subscriptions","organizations_url":"https://api.github.com/users/jonapgar/orgs","repos_url":"https://api.github.com/users/jonapgar/repos","events_url":"https://api.github.com/users/jonapgar/events{/privacy}","received_events_url":"https://api.github.com/users/jonapgar/received_events","type":"User","site_admin":false},"body":"I was looking for ways to speed up mysql.format after noticing that the performance was *very* slow when attempting to format a query with 100,000+ values. I came up with a couple of improvements, by far the most significant is to use an iterator to step through the values array instead of Array.shift(). See: http://jsperf.com/some-array-reading-comparisons/6","created_at":"2015-02-27T19:13:22Z","updated_at":"2015-04-08T03:18:54Z","closed_at":"2015-03-08T06:45:39Z","merged_at":null,"merge_commit_sha":"9fb3522d852bb9a9fd16bc300815cdafb4d9dde0","assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/felixge/node-mysql/milestones/8","html_url":"https://github.com/felixge/node-mysql/milestones/2.6","labels_url":"https://api.github.com/repos/felixge/node-mysql/milestones/8/labels","id":793348,"number":8,"title":"2.6","description":"","creator":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":6,"state":"closed","created_at":"2014-09-17T16:37:30Z","updated_at":"2015-03-25T02:24:54Z","due_on":null,"closed_at":"2015-03-25T02:24:54Z"},"commits_url":"https://api.github.com/repos/felixge/node-mysql/pulls/1019/commits","review_comments_url":"https://api.github.com/repos/felixge/node-mysql/pulls/1019/comments","review_comment_url":"https://api.github.com/repos/felixge/node-mysql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/felixge/node-mysql/issues/1019/comments","statuses_url":"https://api.github.com/repos/felixge/node-mysql/statuses/187cfa1edccaa1c7c7ce600c05028813c970b8f9","head":{"label":"jonapgar:patch-1","ref":"patch-1","sha":"187cfa1edccaa1c7c7ce600c05028813c970b8f9","user":{"login":"jonapgar","id":4521221,"avatar_url":"https://avatars.githubusercontent.com/u/4521221?v=3","gravatar_id":"","url":"https://api.github.com/users/jonapgar","html_url":"https://github.com/jonapgar","followers_url":"https://api.github.com/users/jonapgar/followers","following_url":"https://api.github.com/users/jonapgar/following{/other_user}","gists_url":"https://api.github.com/users/jonapgar/gists{/gist_id}","starred_url":"https://api.github.com/users/jonapgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonapgar/subscriptions","organizations_url":"https://api.github.com/users/jonapgar/orgs","repos_url":"https://api.github.com/users/jonapgar/repos","events_url":"https://api.github.com/users/jonapgar/events{/privacy}","received_events_url":"https://api.github.com/users/jonapgar/received_events","type":"User","site_admin":false},"repo":{"id":31434674,"name":"node-mysql","full_name":"jonapgar/node-mysql","owner":{"login":"jonapgar","id":4521221,"avatar_url":"https://avatars.githubusercontent.com/u/4521221?v=3","gravatar_id":"","url":"https://api.github.com/users/jonapgar","html_url":"https://github.com/jonapgar","followers_url":"https://api.github.com/users/jonapgar/followers","following_url":"https://api.github.com/users/jonapgar/following{/other_user}","gists_url":"https://api.github.com/users/jonapgar/gists{/gist_id}","starred_url":"https://api.github.com/users/jonapgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonapgar/subscriptions","organizations_url":"https://api.github.com/users/jonapgar/orgs","repos_url":"https://api.github.com/users/jonapgar/repos","events_url":"https://api.github.com/users/jonapgar/events{/privacy}","received_events_url":"https://api.github.com/users/jonapgar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonapgar/node-mysql","description":"A pure node.js JavaScript Client implementing the MySql protocol.","fork":true,"url":"https://api.github.com/repos/jonapgar/node-mysql","forks_url":"https://api.github.com/repos/jonapgar/node-mysql/forks","keys_url":"https://api.github.com/repos/jonapgar/node-mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonapgar/node-mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonapgar/node-mysql/teams","hooks_url":"https://api.github.com/repos/jonapgar/node-mysql/hooks","issue_events_url":"https://api.github.com/repos/jonapgar/node-mysql/issues/events{/number}","events_url":"https://api.github.com/repos/jonapgar/node-mysql/events","assignees_url":"https://api.github.com/repos/jonapgar/node-mysql/assignees{/user}","branches_url":"https://api.github.com/repos/jonapgar/node-mysql/branches{/branch}","tags_url":"https://api.github.com/repos/jonapgar/node-mysql/tags","blobs_url":"https://api.github.com/repos/jonapgar/node-mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonapgar/node-mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonapgar/node-mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonapgar/node-mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonapgar/node-mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/jonapgar/node-mysql/languages","stargazers_url":"https://api.github.com/repos/jonapgar/node-mysql/stargazers","contributors_url":"https://api.github.com/repos/jonapgar/node-mysql/contributors","subscribers_url":"https://api.github.com/repos/jonapgar/node-mysql/subscribers","subscription_url":"https://api.github.com/repos/jonapgar/node-mysql/subscription","commits_url":"https://api.github.com/repos/jonapgar/node-mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonapgar/node-mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonapgar/node-mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonapgar/node-mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonapgar/node-mysql/contents/{+path}","compare_url":"https://api.github.com/repos/jonapgar/node-mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonapgar/node-mysql/merges","archive_url":"https://api.github.com/repos/jonapgar/node-mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonapgar/node-mysql/downloads","issues_url":"https://api.github.com/repos/jonapgar/node-mysql/issues{/number}","pulls_url":"https://api.github.com/repos/jonapgar/node-mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/jonapgar/node-mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/jonapgar/node-mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonapgar/node-mysql/labels{/name}","releases_url":"https://api.github.com/repos/jonapgar/node-mysql/releases{/id}","created_at":"2015-02-27T19:09:11Z","updated_at":"2015-02-27T19:09:12Z","pushed_at":"2015-02-27T19:12:14Z","git_url":"git://github.com/jonapgar/node-mysql.git","ssh_url":"git@github.com:jonapgar/node-mysql.git","clone_url":"https://github.com/jonapgar/node-mysql.git","svn_url":"https://github.com/jonapgar/node-mysql","homepage":"","size":2159,"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":"master"}},"base":{"label":"felixge:master","ref":"master","sha":"6e09a484e437c970d757d0a09c62ac729907af6f","user":{"login":"felixge","id":15000,"avatar_url":"https://avatars.githubusercontent.com/u/15000?v=3","gravatar_id":"","url":"https://api.github.com/users/felixge","html_url":"https://github.com/felixge","followers_url":"https://api.github.com/users/felixge/followers","following_url":"https://api.github.com/users/felixge/following{/other_user}","gists_url":"https://api.github.com/users/felixge/gists{/gist_id}","starred_url":"https://api.github.com/users/felixge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixge/subscriptions","organizations_url":"https://api.github.com/users/felixge/orgs","repos_url":"https://api.github.com/users/felixge/repos","events_url":"https://api.github.com/users/felixge/events{/privacy}","received_events_url":"https://api.github.com/users/felixge/received_events","type":"User","site_admin":false},"repo":{"id":805461,"name":"node-mysql","full_name":"felixge/node-mysql","owner":{"login":"felixge","id":15000,"avatar_url":"https://avatars.githubusercontent.com/u/15000?v=3","gravatar_id":"","url":"https://api.github.com/users/felixge","html_url":"https://github.com/felixge","followers_url":"https://api.github.com/users/felixge/followers","following_url":"https://api.github.com/users/felixge/following{/other_user}","gists_url":"https://api.github.com/users/felixge/gists{/gist_id}","starred_url":"https://api.github.com/users/felixge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixge/subscriptions","organizations_url":"https://api.github.com/users/felixge/orgs","repos_url":"https://api.github.com/users/felixge/repos","events_url":"https://api.github.com/users/felixge/events{/privacy}","received_events_url":"https://api.github.com/users/felixge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felixge/node-mysql","description":"A pure node.js JavaScript Client implementing the MySql protocol.","fork":false,"url":"https://api.github.com/repos/felixge/node-mysql","forks_url":"https://api.github.com/repos/felixge/node-mysql/forks","keys_url":"https://api.github.com/repos/felixge/node-mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felixge/node-mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felixge/node-mysql/teams","hooks_url":"https://api.github.com/repos/felixge/node-mysql/hooks","issue_events_url":"https://api.github.com/repos/felixge/node-mysql/issues/events{/number}","events_url":"https://api.github.com/repos/felixge/node-mysql/events","assignees_url":"https://api.github.com/repos/felixge/node-mysql/assignees{/user}","branches_url":"https://api.github.com/repos/felixge/node-mysql/branches{/branch}","tags_url":"https://api.github.com/repos/felixge/node-mysql/tags","blobs_url":"https://api.github.com/repos/felixge/node-mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felixge/node-mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felixge/node-mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/felixge/node-mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felixge/node-mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/felixge/node-mysql/languages","stargazers_url":"https://api.github.com/repos/felixge/node-mysql/stargazers","contributors_url":"https://api.github.com/repos/felixge/node-mysql/contributors","subscribers_url":"https://api.github.com/repos/felixge/node-mysql/subscribers","subscription_url":"https://api.github.com/repos/felixge/node-mysql/subscription","commits_url":"https://api.github.com/repos/felixge/node-mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/felixge/node-mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/felixge/node-mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/felixge/node-mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/felixge/node-mysql/contents/{+path}","compare_url":"https://api.github.com/repos/felixge/node-mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felixge/node-mysql/merges","archive_url":"https://api.github.com/repos/felixge/node-mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felixge/node-mysql/downloads","issues_url":"https://api.github.com/repos/felixge/node-mysql/issues{/number}","pulls_url":"https://api.github.com/repos/felixge/node-mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/felixge/node-mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/felixge/node-mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felixge/node-mysql/labels{/name}","releases_url":"https://api.github.com/repos/felixge/node-mysql/releases{/id}","created_at":"2010-07-29T14:58:13Z","updated_at":"2015-04-07T18:24:41Z","pushed_at":"2015-04-08T00:22:17Z","git_url":"git://github.com/felixge/node-mysql.git","ssh_url":"git@github.com:felixge/node-mysql.git","clone_url":"https://github.com/felixge/node-mysql.git","svn_url":"https://github.com/felixge/node-mysql","homepage":"","size":5622,"stargazers_count":4631,"watchers_count":4631,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":779,"mirror_url":null,"open_issues_count":72,"forks":779,"open_issues":72,"watchers":4631,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/1019"},"html":{"href":"https://github.com/felixge/node-mysql/pull/1019"},"issue":{"href":"https://api.github.com/repos/felixge/node-mysql/issues/1019"},"comments":{"href":"https://api.github.com/repos/felixge/node-mysql/issues/1019/comments"},"review_comments":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/1019/comments"},"review_comment":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/felixge/node-mysql/pulls/1019/commits"},"statuses":{"href":"https://api.github.com/repos/felixge/node-mysql/statuses/187cfa1edccaa1c7c7ce600c05028813c970b8f9"}}}}