{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/195141971","pull_request_review_id":128449188,"id":195141971,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTE0MTk3MQ==","diff_hunk":"@@ -0,0 +1,165 @@\n+'use strict';","path":"benchmark/async_hooks/current-resource-vs-destroy.js","position":1,"original_position":1,"commit_id":"15ffe722be1ae8c1ef866737cff68ba3cbd2abaa","original_commit_id":"15ffe722be1ae8c1ef866737cff68ba3cbd2abaa","user":{"login":"mike-kaufman","id":8702326,"node_id":"MDQ6VXNlcjg3MDIzMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/8702326?v=4","gravatar_id":"","url":"https://api.github.com/users/mike-kaufman","html_url":"https://github.com/mike-kaufman","followers_url":"https://api.github.com/users/mike-kaufman/followers","following_url":"https://api.github.com/users/mike-kaufman/following{/other_user}","gists_url":"https://api.github.com/users/mike-kaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-kaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-kaufman/subscriptions","organizations_url":"https://api.github.com/users/mike-kaufman/orgs","repos_url":"https://api.github.com/users/mike-kaufman/repos","events_url":"https://api.github.com/users/mike-kaufman/events{/privacy}","received_events_url":"https://api.github.com/users/mike-kaufman/received_events","type":"User","site_admin":false},"body":"IMO some comments explaining what this benchmark is testing will help readers going forward.","created_at":"2018-06-13T15:59:32Z","updated_at":"2018-06-13T15:59:32Z","html_url":"https://github.com/nodejs/node/pull/21313#discussion_r195141971","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/21313","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/195141971"},"html":{"href":"https://github.com/nodejs/node/pull/21313#discussion_r195141971"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/21313"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/21313","id":194593268,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTkzMjY4","html_url":"https://github.com/nodejs/node/pull/21313","diff_url":"https://github.com/nodejs/node/pull/21313.diff","patch_url":"https://github.com/nodejs/node/pull/21313.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/21313","number":21313,"state":"open","locked":false,"title":"async_hooks: add currentResource","user":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"body":"Remove the need for the destroy hook in the basic APM case.\r\nAPM and continuation local storage users can use only the init hook.\r\n\r\nThis lead to a 5% improvement in throughput. in the attached benchmark:\r\n\r\n```\r\nasync_hooks/current-resource-vs-destroy.js n=1000000 method=\"callbacks\" type=\"current-resource\" benchmarker=\"wrk\": 7,428.04\r\nasync_hooks/current-resource-vs-destroy.js n=1000000 method=\"async\" type=\"current-resource\" benchmarker=\"wrk\": 5,938.27\r\nasync_hooks/current-resource-vs-destroy.js n=1000000 method=\"callbacks\" type=\"destroy\" benchmarker=\"wrk\": 7,142.18\r\nasync_hooks/current-resource-vs-destroy.js n=1000000 method=\"async\" type=\"destroy\" benchmarker=\"wrk\": 5,297.4\r\n```\r\n\r\nI've also measured this against a simple Hapi v17 server and it leads to a 15% improvement.\r\n\r\ncc @nodejs/diagnostics @bmeurer @MayaLekova\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)\r\n","created_at":"2018-06-13T13:50:09Z","updated_at":"2018-06-13T15:59:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5f36b9db4c496b4865b9a0146d35fa19b7ff725","assignee":null,"assignees":[],"requested_reviewers":[{"login":"watson","id":10602,"node_id":"MDQ6VXNlcjEwNjAy","avatar_url":"https://avatars3.githubusercontent.com/u/10602?v=4","gravatar_id":"","url":"https://api.github.com/users/watson","html_url":"https://github.com/watson","followers_url":"https://api.github.com/users/watson/followers","following_url":"https://api.github.com/users/watson/following{/other_user}","gists_url":"https://api.github.com/users/watson/gists{/gist_id}","starred_url":"https://api.github.com/users/watson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watson/subscriptions","organizations_url":"https://api.github.com/users/watson/orgs","repos_url":"https://api.github.com/users/watson/repos","events_url":"https://api.github.com/users/watson/events{/privacy}","received_events_url":"https://api.github.com/users/watson/received_events","type":"User","site_admin":false},{"login":"ofrobots","id":79017,"node_id":"MDQ6VXNlcjc5MDE3","avatar_url":"https://avatars1.githubusercontent.com/u/79017?v=4","gravatar_id":"","url":"https://api.github.com/users/ofrobots","html_url":"https://github.com/ofrobots","followers_url":"https://api.github.com/users/ofrobots/followers","following_url":"https://api.github.com/users/ofrobots/following{/other_user}","gists_url":"https://api.github.com/users/ofrobots/gists{/gist_id}","starred_url":"https://api.github.com/users/ofrobots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofrobots/subscriptions","organizations_url":"https://api.github.com/users/ofrobots/orgs","repos_url":"https://api.github.com/users/ofrobots/repos","events_url":"https://api.github.com/users/ofrobots/events{/privacy}","received_events_url":"https://api.github.com/users/ofrobots/received_events","type":"User","site_admin":false},{"login":"AndreasMadsen","id":505333,"node_id":"MDQ6VXNlcjUwNTMzMw==","avatar_url":"https://avatars0.githubusercontent.com/u/505333?v=4","gravatar_id":"","url":"https://api.github.com/users/AndreasMadsen","html_url":"https://github.com/AndreasMadsen","followers_url":"https://api.github.com/users/AndreasMadsen/followers","following_url":"https://api.github.com/users/AndreasMadsen/following{/other_user}","gists_url":"https://api.github.com/users/AndreasMadsen/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreasMadsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreasMadsen/subscriptions","organizations_url":"https://api.github.com/users/AndreasMadsen/orgs","repos_url":"https://api.github.com/users/AndreasMadsen/repos","events_url":"https://api.github.com/users/AndreasMadsen/events{/privacy}","received_events_url":"https://api.github.com/users/AndreasMadsen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":442446525,"node_id":"MDU6TGFiZWw0NDI0NDY1MjU=","url":"https://api.github.com/repos/nodejs/node/labels/async_hooks","name":"async_hooks","color":"ededed","default":false},{"id":281232761,"node_id":"MDU6TGFiZWwyODEyMzI3NjE=","url":"https://api.github.com/repos/nodejs/node/labels/lib%20/%20src","name":"lib / src","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/21313/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/21313/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/21313/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/15ffe722be1ae8c1ef866737cff68ba3cbd2abaa","head":{"label":"mcollina:current-resource","ref":"current-resource","sha":"15ffe722be1ae8c1ef866737cff68ba3cbd2abaa","user":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"repo":{"id":36234606,"node_id":"MDEwOlJlcG9zaXRvcnkzNjIzNDYwNg==","name":"node","full_name":"mcollina/node","owner":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mcollina/node","description":"My fork of node","fork":true,"url":"https://api.github.com/repos/mcollina/node","forks_url":"https://api.github.com/repos/mcollina/node/forks","keys_url":"https://api.github.com/repos/mcollina/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcollina/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcollina/node/teams","hooks_url":"https://api.github.com/repos/mcollina/node/hooks","issue_events_url":"https://api.github.com/repos/mcollina/node/issues/events{/number}","events_url":"https://api.github.com/repos/mcollina/node/events","assignees_url":"https://api.github.com/repos/mcollina/node/assignees{/user}","branches_url":"https://api.github.com/repos/mcollina/node/branches{/branch}","tags_url":"https://api.github.com/repos/mcollina/node/tags","blobs_url":"https://api.github.com/repos/mcollina/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcollina/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcollina/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcollina/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcollina/node/statuses/{sha}","languages_url":"https://api.github.com/repos/mcollina/node/languages","stargazers_url":"https://api.github.com/repos/mcollina/node/stargazers","contributors_url":"https://api.github.com/repos/mcollina/node/contributors","subscribers_url":"https://api.github.com/repos/mcollina/node/subscribers","subscription_url":"https://api.github.com/repos/mcollina/node/subscription","commits_url":"https://api.github.com/repos/mcollina/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcollina/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcollina/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcollina/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcollina/node/contents/{+path}","compare_url":"https://api.github.com/repos/mcollina/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcollina/node/merges","archive_url":"https://api.github.com/repos/mcollina/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcollina/node/downloads","issues_url":"https://api.github.com/repos/mcollina/node/issues{/number}","pulls_url":"https://api.github.com/repos/mcollina/node/pulls{/number}","milestones_url":"https://api.github.com/repos/mcollina/node/milestones{/number}","notifications_url":"https://api.github.com/repos/mcollina/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcollina/node/labels{/name}","releases_url":"https://api.github.com/repos/mcollina/node/releases{/id}","deployments_url":"https://api.github.com/repos/mcollina/node/deployments","created_at":"2015-05-25T14:06:50Z","updated_at":"2018-04-05T07:30:19Z","pushed_at":"2018-06-13T13:51:15Z","git_url":"git://github.com/mcollina/node.git","ssh_url":"git@github.com:mcollina/node.git","clone_url":"https://github.com/mcollina/node.git","svn_url":"https://github.com/mcollina/node","homepage":"","size":349475,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"aa2304b8d5c53ba2d9710d8b8ed4482f3cbd1192","user":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"node_id":"MDEwOlJlcG9zaXRvcnkyNzE5Mzc3OQ==","name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-06-13T15:36:06Z","pushed_at":"2018-06-13T15:53:23Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":384441,"stargazers_count":50232,"watchers_count":50232,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10563,"mirror_url":null,"archived":false,"open_issues_count":735,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10563,"open_issues":735,"watchers":50232,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/21313"},"html":{"href":"https://github.com/nodejs/node/pull/21313"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/21313"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/21313/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/21313/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/21313/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/15ffe722be1ae8c1ef866737cff68ba3cbd2abaa"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mike-kaufman"}}