{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/influxdb/pulls/comments/210410598","pull_request_review_id":146621831,"id":210410598,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDQxMDU5OA==","diff_hunk":"@@ -60,6 +66,24 @@ func BenchmarkEncode(b *testing.B) {\n \t}\n }\n \n+func BenchmarkNext(b *testing.B) {\n+\tg := New(10)\n+\n+\tfor i := 0; i < b.N; i++ {\n+\t\tg.Next()\n+\t}\n+}\n+\n+func BenchmarkNextParallel(b *testing.B) {\n+\tg := New(1)\n+\n+\tb.RunParallel(func(pb *testing.PB) {\n+\t\tfor pb.Next() {\n+\t\t\tg.Next()\n+\t\t}\n+\t})\n+}","path":"pkg/snowflake/gen_test.go","position":33,"original_position":33,"commit_id":"485bd2de23aa9dea24fdae95ea90cbe053c7c801","original_commit_id":"485bd2de23aa9dea24fdae95ea90cbe053c7c801","user":{"login":"zeebo","id":96925,"node_id":"MDQ6VXNlcjk2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/96925?v=4","gravatar_id":"","url":"https://api.github.com/users/zeebo","html_url":"https://github.com/zeebo","followers_url":"https://api.github.com/users/zeebo/followers","following_url":"https://api.github.com/users/zeebo/following{/other_user}","gists_url":"https://api.github.com/users/zeebo/gists{/gist_id}","starred_url":"https://api.github.com/users/zeebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeebo/subscriptions","organizations_url":"https://api.github.com/users/zeebo/orgs","repos_url":"https://api.github.com/users/zeebo/repos","events_url":"https://api.github.com/users/zeebo/events{/privacy}","received_events_url":"https://api.github.com/users/zeebo/received_events","type":"User","site_admin":false},"body":"It actually isn't in this case (confirmed with -gcflags=-S), but I'll update to make sure it doesn't happen in the future as best as I'm able.","created_at":"2018-08-15T21:10:28Z","updated_at":"2018-08-15T21:10:28Z","html_url":"https://github.com/influxdata/influxdb/pull/10197#discussion_r210410598","pull_request_url":"https://api.github.com/repos/influxdata/influxdb/pulls/10197","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/comments/210410598"},"html":{"href":"https://github.com/influxdata/influxdb/pull/10197#discussion_r210410598"},"pull_request":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/10197"}},"in_reply_to_id":210392828},"pull_request":{"url":"https://api.github.com/repos/influxdata/influxdb/pulls/10197","id":208607399,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NjA3Mzk5","html_url":"https://github.com/influxdata/influxdb/pull/10197","diff_url":"https://github.com/influxdata/influxdb/pull/10197.diff","patch_url":"https://github.com/influxdata/influxdb/pull/10197.patch","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/10197","number":10197,"state":"open","locked":false,"title":"pkg/snowflake: reduce contention in Next calls","user":{"login":"zeebo","id":96925,"node_id":"MDQ6VXNlcjk2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/96925?v=4","gravatar_id":"","url":"https://api.github.com/users/zeebo","html_url":"https://github.com/zeebo","followers_url":"https://api.github.com/users/zeebo/followers","following_url":"https://api.github.com/users/zeebo/following{/other_user}","gists_url":"https://api.github.com/users/zeebo/gists{/gist_id}","starred_url":"https://api.github.com/users/zeebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeebo/subscriptions","organizations_url":"https://api.github.com/users/zeebo/orgs","repos_url":"https://api.github.com/users/zeebo/repos","events_url":"https://api.github.com/users/zeebo/events{/privacy}","received_events_url":"https://api.github.com/users/zeebo/received_events","type":"User","site_admin":false},"body":"use atomics rather than mutexes to synchronize state between calls.\r\n\r\n```\r\nname            old time/op  new time/op  delta\r\nNext-8           244ns ± 0%    30ns ± 2%  -87.70%  (p=0.000 n=8+7)\r\nNextParallel-8   215µs ±60%     0µs ± 1%  -99.96%  (p=0.000 n=8+8)\r\n```\r\n\r\nThe results for NextParallel are around ~80ns/op, but that doesn't\r\nshow up in the benchstat output.\r\n","created_at":"2018-08-15T16:06:28Z","updated_at":"2018-08-15T21:10:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc3f3192ed577ed9864a3b6be53c092015a89ca7","assignee":{"login":"zeebo","id":96925,"node_id":"MDQ6VXNlcjk2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/96925?v=4","gravatar_id":"","url":"https://api.github.com/users/zeebo","html_url":"https://github.com/zeebo","followers_url":"https://api.github.com/users/zeebo/followers","following_url":"https://api.github.com/users/zeebo/following{/other_user}","gists_url":"https://api.github.com/users/zeebo/gists{/gist_id}","starred_url":"https://api.github.com/users/zeebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeebo/subscriptions","organizations_url":"https://api.github.com/users/zeebo/orgs","repos_url":"https://api.github.com/users/zeebo/repos","events_url":"https://api.github.com/users/zeebo/events{/privacy}","received_events_url":"https://api.github.com/users/zeebo/received_events","type":"User","site_admin":false},"assignees":[{"login":"zeebo","id":96925,"node_id":"MDQ6VXNlcjk2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/96925?v=4","gravatar_id":"","url":"https://api.github.com/users/zeebo","html_url":"https://github.com/zeebo","followers_url":"https://api.github.com/users/zeebo/followers","following_url":"https://api.github.com/users/zeebo/following{/other_user}","gists_url":"https://api.github.com/users/zeebo/gists{/gist_id}","starred_url":"https://api.github.com/users/zeebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeebo/subscriptions","organizations_url":"https://api.github.com/users/zeebo/orgs","repos_url":"https://api.github.com/users/zeebo/repos","events_url":"https://api.github.com/users/zeebo/events{/privacy}","received_events_url":"https://api.github.com/users/zeebo/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":136598261,"node_id":"MDU6TGFiZWwxMzY1OTgyNjE=","url":"https://api.github.com/repos/influxdata/influxdb/labels/review","name":"review","color":"bfe5bf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/influxdb/pulls/10197/commits","review_comments_url":"https://api.github.com/repos/influxdata/influxdb/pulls/10197/comments","review_comment_url":"https://api.github.com/repos/influxdata/influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/10197/comments","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/485bd2de23aa9dea24fdae95ea90cbe053c7c801","head":{"label":"influxdata:jmw-snowflake-contention","ref":"jmw-snowflake-contention","sha":"485bd2de23aa9dea24fdae95ea90cbe053c7c801","user":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEyNDgwMg==","name":"influxdb","full_name":"influxdata/influxdb","owner":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdata/influxdb","forks_url":"https://api.github.com/repos/influxdata/influxdb/forks","keys_url":"https://api.github.com/repos/influxdata/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdata/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdata/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/influxdb/events","assignees_url":"https://api.github.com/repos/influxdata/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdata/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdata/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdata/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdata/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdata/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdata/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/influxdb/merges","archive_url":"https://api.github.com/repos/influxdata/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdata/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/influxdb/deployments","created_at":"2013-09-26T14:31:10Z","updated_at":"2018-08-15T20:50:51Z","pushed_at":"2018-08-15T17:11:36Z","git_url":"git://github.com/influxdata/influxdb.git","ssh_url":"git@github.com:influxdata/influxdb.git","clone_url":"https://github.com/influxdata/influxdb.git","svn_url":"https://github.com/influxdata/influxdb","homepage":"https://influxdata.com","size":66567,"stargazers_count":14065,"watchers_count":14065,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2044,"mirror_url":null,"archived":false,"open_issues_count":801,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2044,"open_issues":801,"watchers":14065,"default_branch":"master"}},"base":{"label":"influxdata:master","ref":"master","sha":"fee13d0150ce088e2a7ce5b05d11e77307e058bf","user":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEyNDgwMg==","name":"influxdb","full_name":"influxdata/influxdb","owner":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdata/influxdb","forks_url":"https://api.github.com/repos/influxdata/influxdb/forks","keys_url":"https://api.github.com/repos/influxdata/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdata/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdata/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/influxdb/events","assignees_url":"https://api.github.com/repos/influxdata/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdata/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdata/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdata/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdata/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdata/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdata/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/influxdb/merges","archive_url":"https://api.github.com/repos/influxdata/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdata/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/influxdb/deployments","created_at":"2013-09-26T14:31:10Z","updated_at":"2018-08-15T20:50:51Z","pushed_at":"2018-08-15T17:11:36Z","git_url":"git://github.com/influxdata/influxdb.git","ssh_url":"git@github.com:influxdata/influxdb.git","clone_url":"https://github.com/influxdata/influxdb.git","svn_url":"https://github.com/influxdata/influxdb","homepage":"https://influxdata.com","size":66567,"stargazers_count":14065,"watchers_count":14065,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2044,"mirror_url":null,"archived":false,"open_issues_count":801,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2044,"open_issues":801,"watchers":14065,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/10197"},"html":{"href":"https://github.com/influxdata/influxdb/pull/10197"},"issue":{"href":"https://api.github.com/repos/influxdata/influxdb/issues/10197"},"comments":{"href":"https://api.github.com/repos/influxdata/influxdb/issues/10197/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/10197/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/influxdb/pulls/10197/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/influxdb/statuses/485bd2de23aa9dea24fdae95ea90cbe053c7c801"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"zeebo"}}