{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/242654789","pull_request_review_id":185870059,"id":242654789,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjY1NDc4OQ==","diff_hunk":"@@ -35,9 +33,9 @@ internal class TdsParserStateObjectNative : TdsParserStateObject\n \n         internal override uint Status => _sessionHandle != null ? _sessionHandle.Status : TdsEnums.SNI_UNINITIALIZED;\n \n-        internal override object SessionHandle => _sessionHandle;\n+        internal override SessionHandle SessionHandle => SessionHandle.FromNativeHandle(_sessionHandle);\n \n-        protected override object EmptyReadPacket => s_cachedEmptyReadPacketObjectPointer;\n+        protected override PacketHandle EmptyReadPacket => default;","path":"src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParserStateObjectNative.cs","position":17,"original_position":17,"commit_id":"1e1f540adefe9915dd0c801271a8579fffeffe20","original_commit_id":"1e1f540adefe9915dd0c801271a8579fffeffe20","user":{"login":"saurabh500","id":1623701,"node_id":"MDQ6VXNlcjE2MjM3MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1623701?v=4","gravatar_id":"","url":"https://api.github.com/users/saurabh500","html_url":"https://github.com/saurabh500","followers_url":"https://api.github.com/users/saurabh500/followers","following_url":"https://api.github.com/users/saurabh500/following{/other_user}","gists_url":"https://api.github.com/users/saurabh500/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabh500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabh500/subscriptions","organizations_url":"https://api.github.com/users/saurabh500/orgs","repos_url":"https://api.github.com/users/saurabh500/repos","events_url":"https://api.github.com/users/saurabh500/events{/privacy}","received_events_url":"https://api.github.com/users/saurabh500/received_events","type":"User","site_admin":false},"body":"This Property accessor could be moved into the Base class now since it's no longer an `object` but a common concrete type. You could take care of it in a PR after this one is merged.","created_at":"2018-12-18T18:35:17Z","updated_at":"2018-12-18T18:37:22Z","html_url":"https://github.com/dotnet/corefx/pull/34044#discussion_r242654789","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/34044","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/242654789"},"html":{"href":"https://github.com/dotnet/corefx/pull/34044#discussion_r242654789"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/34044"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/34044","id":238200714,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjAwNzE0","html_url":"https://github.com/dotnet/corefx/pull/34044","diff_url":"https://github.com/dotnet/corefx/pull/34044.diff","patch_url":"https://github.com/dotnet/corefx/pull/34044.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/34044","number":34044,"state":"open","locked":false,"title":"Optimize SqlClient tds state to remove handle boxing","user":{"login":"Wraith2","id":13322696,"node_id":"MDQ6VXNlcjEzMzIyNjk2","avatar_url":"https://avatars0.githubusercontent.com/u/13322696?v=4","gravatar_id":"","url":"https://api.github.com/users/Wraith2","html_url":"https://github.com/Wraith2","followers_url":"https://api.github.com/users/Wraith2/followers","following_url":"https://api.github.com/users/Wraith2/following{/other_user}","gists_url":"https://api.github.com/users/Wraith2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wraith2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wraith2/subscriptions","organizations_url":"https://api.github.com/users/Wraith2/orgs","repos_url":"https://api.github.com/users/Wraith2/repos","events_url":"https://api.github.com/users/Wraith2/events{/privacy}","received_events_url":"https://api.github.com/users/Wraith2/received_events","type":"User","site_admin":false},"body":"These changes remove constant boxing of session and packet IntPtr when using the native implementation of TdsParserStateObject (native is used in windows non-uap builds) which improves memory performance. Making these changes also allows assertion of the handle types in debug builds which adds safety and testability.\r\n\r\nI have added a project define constant called `FEATURE_INTEROPSNI` so that unix or uap builds which don't include the interop definitions also don't include the IntPtr field in the `PacketHandle` and `SessionHandle` ref structs I have added. I have used ref structs to ensure that the types can only be used to pass information through the abstract methods that define the interface between the core parser logic and the native/managed specific elements, these handles can never be accidentally stored or take part in async activity.\r\n\r\nPerformance profiling results were posted in https://github.com/dotnet/corefx/pull/33155 and show approximately ~13% speed increase on small write performance and lower GC frequency.\r\n\r\nThis PR was split from #33155 for easier review.\r\n/cc @keeratsingh @AfsanehR @saurabh500 @David-Engel","created_at":"2018-12-12T22:15:20Z","updated_at":"2018-12-18T18:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae47bb14316a2c466e9df16467efdf6fef772ee3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":335854516,"node_id":"MDU6TGFiZWwzMzU4NTQ1MTY=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Data.SqlClient","name":"area-System.Data.SqlClient","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/34044/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/34044/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/34044/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/1e1f540adefe9915dd0c801271a8579fffeffe20","head":{"label":"Wraith2:sqlperf-packetstruct","ref":"sqlperf-packetstruct","sha":"1e1f540adefe9915dd0c801271a8579fffeffe20","user":{"login":"Wraith2","id":13322696,"node_id":"MDQ6VXNlcjEzMzIyNjk2","avatar_url":"https://avatars0.githubusercontent.com/u/13322696?v=4","gravatar_id":"","url":"https://api.github.com/users/Wraith2","html_url":"https://github.com/Wraith2","followers_url":"https://api.github.com/users/Wraith2/followers","following_url":"https://api.github.com/users/Wraith2/following{/other_user}","gists_url":"https://api.github.com/users/Wraith2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wraith2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wraith2/subscriptions","organizations_url":"https://api.github.com/users/Wraith2/orgs","repos_url":"https://api.github.com/users/Wraith2/repos","events_url":"https://api.github.com/users/Wraith2/events{/privacy}","received_events_url":"https://api.github.com/users/Wraith2/received_events","type":"User","site_admin":false},"repo":{"id":137270990,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNzA5OTA=","name":"corefx","full_name":"Wraith2/corefx","private":false,"owner":{"login":"Wraith2","id":13322696,"node_id":"MDQ6VXNlcjEzMzIyNjk2","avatar_url":"https://avatars0.githubusercontent.com/u/13322696?v=4","gravatar_id":"","url":"https://api.github.com/users/Wraith2","html_url":"https://github.com/Wraith2","followers_url":"https://api.github.com/users/Wraith2/followers","following_url":"https://api.github.com/users/Wraith2/following{/other_user}","gists_url":"https://api.github.com/users/Wraith2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wraith2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wraith2/subscriptions","organizations_url":"https://api.github.com/users/Wraith2/orgs","repos_url":"https://api.github.com/users/Wraith2/repos","events_url":"https://api.github.com/users/Wraith2/events{/privacy}","received_events_url":"https://api.github.com/users/Wraith2/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Wraith2/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":true,"url":"https://api.github.com/repos/Wraith2/corefx","forks_url":"https://api.github.com/repos/Wraith2/corefx/forks","keys_url":"https://api.github.com/repos/Wraith2/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wraith2/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wraith2/corefx/teams","hooks_url":"https://api.github.com/repos/Wraith2/corefx/hooks","issue_events_url":"https://api.github.com/repos/Wraith2/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/Wraith2/corefx/events","assignees_url":"https://api.github.com/repos/Wraith2/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/Wraith2/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/Wraith2/corefx/tags","blobs_url":"https://api.github.com/repos/Wraith2/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wraith2/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wraith2/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wraith2/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wraith2/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/Wraith2/corefx/languages","stargazers_url":"https://api.github.com/repos/Wraith2/corefx/stargazers","contributors_url":"https://api.github.com/repos/Wraith2/corefx/contributors","subscribers_url":"https://api.github.com/repos/Wraith2/corefx/subscribers","subscription_url":"https://api.github.com/repos/Wraith2/corefx/subscription","commits_url":"https://api.github.com/repos/Wraith2/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wraith2/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wraith2/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wraith2/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wraith2/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/Wraith2/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wraith2/corefx/merges","archive_url":"https://api.github.com/repos/Wraith2/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wraith2/corefx/downloads","issues_url":"https://api.github.com/repos/Wraith2/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/Wraith2/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/Wraith2/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/Wraith2/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wraith2/corefx/labels{/name}","releases_url":"https://api.github.com/repos/Wraith2/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/Wraith2/corefx/deployments","created_at":"2018-06-13T21:06:15Z","updated_at":"2018-12-15T11:49:25Z","pushed_at":"2018-12-18T00:24:00Z","git_url":"git://github.com/Wraith2/corefx.git","ssh_url":"git@github.com:Wraith2/corefx.git","clone_url":"https://github.com/Wraith2/corefx.git","svn_url":"https://github.com/Wraith2/corefx","homepage":"https://github.com/dotnet/core","size":193849,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"245d532bb6a984b4ba0db4c438c58775da61c657","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI5NTM0NQ==","name":"corefx","full_name":"dotnet/corefx","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotnet/corefx","description":"CoreFX is the foundational class libraries for .NET Core. It includes types for collections, file systems, console, JSON, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2018-12-18T18:13:11Z","pushed_at":"2018-12-18T18:27:52Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://docs.microsoft.com/dotnet/core/","size":195133,"stargazers_count":15377,"watchers_count":15377,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4582,"mirror_url":null,"archived":false,"open_issues_count":2737,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4582,"open_issues":2737,"watchers":15377,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/34044"},"html":{"href":"https://github.com/dotnet/corefx/pull/34044"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/34044"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/34044/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/34044/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/34044/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/1e1f540adefe9915dd0c801271a8579fffeffe20"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"saurabh500"}}