{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/7986","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/7986/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/7986/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/7986/events","html_url":"https://github.com/dotnet/coreclr/issues/7986","id":187220627,"number":7986,"title":"List<T>.Reverse boxes every element in the array if it's instantiated with a struct type.","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T23:54:54Z","updated_at":"2016-11-03T23:54:54Z","closed_at":null,"body":"At https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Collections/Generic/List.cs#L931 ```List<T>``` calls into Array.Reverse to actually implement reversing the elements.  However Array.Reverse implements this here: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Array.cs#L1593\r\n\r\nThis impl ends up doing the following:\r\n\r\n```c#\r\nObject temp = array.GetValue(i);\r\narray.SetValue(array.GetValue(j), i);\r\narray.SetValue(temp, j);\r\n```\r\n\r\nwhich involves a boxing of every object in the array when the array is a struct type.\r\n"}}
{"actor":{"display_login":"CyrusNajmabadi"}}