{"action":"opened","number":18,"pull_request":{"url":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18","id":190783517,"html_url":"https://github.com/davidebbo/ReflectionMagic/pull/18","diff_url":"https://github.com/davidebbo/ReflectionMagic/pull/18.diff","patch_url":"https://github.com/davidebbo/ReflectionMagic/pull/18.patch","issue_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/18","number":18,"state":"open","locked":false,"title":"Reduce usage of LINQ in constructor selection","user":{"login":"jvandertil","id":158879,"avatar_url":"https://avatars1.githubusercontent.com/u/158879?v=4","gravatar_id":"","url":"https://api.github.com/users/jvandertil","html_url":"https://github.com/jvandertil","followers_url":"https://api.github.com/users/jvandertil/followers","following_url":"https://api.github.com/users/jvandertil/following{/other_user}","gists_url":"https://api.github.com/users/jvandertil/gists{/gist_id}","starred_url":"https://api.github.com/users/jvandertil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvandertil/subscriptions","organizations_url":"https://api.github.com/users/jvandertil/orgs","repos_url":"https://api.github.com/users/jvandertil/repos","events_url":"https://api.github.com/users/jvandertil/events{/privacy}","received_events_url":"https://api.github.com/users/jvandertil/received_events","type":"User","site_admin":false},"body":"The current implementation uses a LINQ based approach for selecting a constructor to work around the issue of not having the correct overload for Activator.CreateInstance() available.\r\n\r\nThis is allocating quite a bit of garbage and is not ideal as can be seen below:\r\n\r\n``` ini\r\n\r\nBenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134\r\nIntel Core i7-7700K CPU 4.20GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores\r\n.NET Core SDK=2.1.201\r\n  [Host]     : .NET Core 1.1.8 (CoreCLR 4.6.26328.01, CoreFX 4.6.24705.01), 64bit RyuJIT\r\n  DefaultJob : .NET Core 1.1.8 (CoreCLR 4.6.26328.01, CoreFX 4.6.24705.01), 64bit RyuJIT\r\n\r\n\r\n```\r\n|                  Method |         Mean |     Error |    StdDev |  Gen 0 | Allocated |\r\n|------------------------ |-------------:|----------:|----------:|-------:|----------:|\r\n| DirectConstructorNoArgs |     2.872 ns | 0.0048 ns | 0.0040 ns | 0.0172 |      72 B |\r\n|          NoArgumentsOld | 1,631.505 ns | 2.1347 ns | 1.6666 ns | 0.3872 |    1624 B |\r\n|          NoArgumentsNew |   281.524 ns | 0.2437 ns | 0.2280 ns | 0.0587 |     248 B |\r\n|       SingleArgumentOld | 1,765.470 ns | 2.6305 ns | 2.4606 ns | 0.4101 |    1728 B |\r\n|       SingleArgumentNew |   374.443 ns | 0.6819 ns | 0.5694 ns | 0.0782 |     328 B |\r\n|         TwoArgumentsOld | 1,800.418 ns | 2.3833 ns | 2.2293 ns | 0.4177 |    1752 B |\r\n|         TwoArgumentsNew |   460.282 ns | 0.2595 ns | 0.2427 ns | 0.0930 |     392 B |\r\n|       EightArgumentsOld | 2,457.870 ns | 1.9476 ns | 1.8218 ns | 0.5226 |    2208 B |\r\n|       EightArgumentsNew |   945.033 ns | 6.9714 ns | 5.8215 ns | 0.2222 |     936 B |\r\n\r\nThis represents a 200-600% increase of performance and a likewise reduction of allocations. Using reflection remains slow ofcourse.","created_at":"2018-05-27T11:46:03Z","updated_at":"2018-05-27T11:46:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18/commits","review_comments_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18/comments","review_comment_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/18/comments","statuses_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/statuses/47425c8888e28621602234e3dcf5be309fe94132","head":{"label":"jvandertil:netstandard15-perf","ref":"netstandard15-perf","sha":"47425c8888e28621602234e3dcf5be309fe94132","user":{"login":"jvandertil","id":158879,"avatar_url":"https://avatars1.githubusercontent.com/u/158879?v=4","gravatar_id":"","url":"https://api.github.com/users/jvandertil","html_url":"https://github.com/jvandertil","followers_url":"https://api.github.com/users/jvandertil/followers","following_url":"https://api.github.com/users/jvandertil/following{/other_user}","gists_url":"https://api.github.com/users/jvandertil/gists{/gist_id}","starred_url":"https://api.github.com/users/jvandertil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvandertil/subscriptions","organizations_url":"https://api.github.com/users/jvandertil/orgs","repos_url":"https://api.github.com/users/jvandertil/repos","events_url":"https://api.github.com/users/jvandertil/events{/privacy}","received_events_url":"https://api.github.com/users/jvandertil/received_events","type":"User","site_admin":false},"repo":{"id":69460273,"name":"ReflectionMagic","full_name":"jvandertil/ReflectionMagic","owner":{"login":"jvandertil","id":158879,"avatar_url":"https://avatars1.githubusercontent.com/u/158879?v=4","gravatar_id":"","url":"https://api.github.com/users/jvandertil","html_url":"https://github.com/jvandertil","followers_url":"https://api.github.com/users/jvandertil/followers","following_url":"https://api.github.com/users/jvandertil/following{/other_user}","gists_url":"https://api.github.com/users/jvandertil/gists{/gist_id}","starred_url":"https://api.github.com/users/jvandertil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvandertil/subscriptions","organizations_url":"https://api.github.com/users/jvandertil/orgs","repos_url":"https://api.github.com/users/jvandertil/repos","events_url":"https://api.github.com/users/jvandertil/events{/privacy}","received_events_url":"https://api.github.com/users/jvandertil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jvandertil/ReflectionMagic","description":"Framework to drastically simplify your private reflection code using C# dynamic","fork":true,"url":"https://api.github.com/repos/jvandertil/ReflectionMagic","forks_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/forks","keys_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/teams","hooks_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/hooks","issue_events_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/issues/events{/number}","events_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/events","assignees_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/assignees{/user}","branches_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/branches{/branch}","tags_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/tags","blobs_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/git/refs{/sha}","trees_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/statuses/{sha}","languages_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/languages","stargazers_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/stargazers","contributors_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/contributors","subscribers_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/subscribers","subscription_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/subscription","commits_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/commits{/sha}","git_commits_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/git/commits{/sha}","comments_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/comments{/number}","issue_comment_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/issues/comments{/number}","contents_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/contents/{+path}","compare_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/merges","archive_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/downloads","issues_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/issues{/number}","pulls_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/pulls{/number}","milestones_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/milestones{/number}","notifications_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/labels{/name}","releases_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/releases{/id}","deployments_url":"https://api.github.com/repos/jvandertil/ReflectionMagic/deployments","created_at":"2016-09-28T12:19:49Z","updated_at":"2016-09-28T12:19:50Z","pushed_at":"2018-05-27T11:40:48Z","git_url":"git://github.com/jvandertil/ReflectionMagic.git","ssh_url":"git@github.com:jvandertil/ReflectionMagic.git","clone_url":"https://github.com/jvandertil/ReflectionMagic.git","svn_url":"https://github.com/jvandertil/ReflectionMagic","homepage":"http://blogs.msdn.com/b/davidebb/archive/2010/01/18/use-c-4-0-dynamic-to-drastically-simplify-your-private-reflection-code.aspx","size":73,"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":"ms-pl","name":"Microsoft Public License","spdx_id":"MS-PL","url":"https://api.github.com/licenses/ms-pl"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"davidebbo:master","ref":"master","sha":"f4956c33497ee4af3a4507eafc727da3b3bf781f","user":{"login":"davidebbo","id":556238,"avatar_url":"https://avatars1.githubusercontent.com/u/556238?v=4","gravatar_id":"","url":"https://api.github.com/users/davidebbo","html_url":"https://github.com/davidebbo","followers_url":"https://api.github.com/users/davidebbo/followers","following_url":"https://api.github.com/users/davidebbo/following{/other_user}","gists_url":"https://api.github.com/users/davidebbo/gists{/gist_id}","starred_url":"https://api.github.com/users/davidebbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidebbo/subscriptions","organizations_url":"https://api.github.com/users/davidebbo/orgs","repos_url":"https://api.github.com/users/davidebbo/repos","events_url":"https://api.github.com/users/davidebbo/events{/privacy}","received_events_url":"https://api.github.com/users/davidebbo/received_events","type":"User","site_admin":false},"repo":{"id":2183925,"name":"ReflectionMagic","full_name":"davidebbo/ReflectionMagic","owner":{"login":"davidebbo","id":556238,"avatar_url":"https://avatars1.githubusercontent.com/u/556238?v=4","gravatar_id":"","url":"https://api.github.com/users/davidebbo","html_url":"https://github.com/davidebbo","followers_url":"https://api.github.com/users/davidebbo/followers","following_url":"https://api.github.com/users/davidebbo/following{/other_user}","gists_url":"https://api.github.com/users/davidebbo/gists{/gist_id}","starred_url":"https://api.github.com/users/davidebbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidebbo/subscriptions","organizations_url":"https://api.github.com/users/davidebbo/orgs","repos_url":"https://api.github.com/users/davidebbo/repos","events_url":"https://api.github.com/users/davidebbo/events{/privacy}","received_events_url":"https://api.github.com/users/davidebbo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidebbo/ReflectionMagic","description":"Framework to drastically simplify your private reflection code using C# dynamic","fork":false,"url":"https://api.github.com/repos/davidebbo/ReflectionMagic","forks_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/forks","keys_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/teams","hooks_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/hooks","issue_events_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/events{/number}","events_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/events","assignees_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/assignees{/user}","branches_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/branches{/branch}","tags_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/tags","blobs_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/statuses/{sha}","languages_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/languages","stargazers_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/stargazers","contributors_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/contributors","subscribers_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/subscribers","subscription_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/subscription","commits_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/contents/{+path}","compare_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/merges","archive_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/downloads","issues_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues{/number}","pulls_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls{/number}","milestones_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/milestones{/number}","notifications_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/labels{/name}","releases_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/releases{/id}","deployments_url":"https://api.github.com/repos/davidebbo/ReflectionMagic/deployments","created_at":"2011-08-10T07:32:51Z","updated_at":"2018-04-09T20:52:03Z","pushed_at":"2017-11-01T22:26:58Z","git_url":"git://github.com/davidebbo/ReflectionMagic.git","ssh_url":"git@github.com:davidebbo/ReflectionMagic.git","clone_url":"https://github.com/davidebbo/ReflectionMagic.git","svn_url":"https://github.com/davidebbo/ReflectionMagic","homepage":"http://blogs.msdn.com/b/davidebb/archive/2010/01/18/use-c-4-0-dynamic-to-drastically-simplify-your-private-reflection-code.aspx","size":59,"stargazers_count":86,"watchers_count":86,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"ms-pl","name":"Microsoft Public License","spdx_id":"MS-PL","url":"https://api.github.com/licenses/ms-pl"},"forks":22,"open_issues":2,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18"},"html":{"href":"https://github.com/davidebbo/ReflectionMagic/pull/18"},"issue":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/18"},"comments":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/davidebbo/ReflectionMagic/statuses/47425c8888e28621602234e3dcf5be309fe94132"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":36,"deletions":11,"changed_files":1}}
{"actor":{"display_login":"jvandertil"}}