{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2903","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2903/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2903/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2903/events","html_url":"https://github.com/aspnet/EntityFramework/pull/2903","id":102471288,"number":2903,"title":"Improve perf for snapshotting original values","user":{"login":"ajcvickers","id":1430078,"avatar_url":"https://avatars.githubusercontent.com/u/1430078?v=3","gravatar_id":"","url":"https://api.github.com/users/ajcvickers","html_url":"https://github.com/ajcvickers","followers_url":"https://api.github.com/users/ajcvickers/followers","following_url":"https://api.github.com/users/ajcvickers/following{/other_user}","gists_url":"https://api.github.com/users/ajcvickers/gists{/gist_id}","starred_url":"https://api.github.com/users/ajcvickers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajcvickers/subscriptions","organizations_url":"https://api.github.com/users/ajcvickers/orgs","repos_url":"https://api.github.com/users/ajcvickers/repos","events_url":"https://api.github.com/users/ajcvickers/events{/privacy}","received_events_url":"https://api.github.com/users/ajcvickers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T22:06:21Z","updated_at":"2015-08-21T22:17:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/2903","html_url":"https://github.com/aspnet/EntityFramework/pull/2903","diff_url":"https://github.com/aspnet/EntityFramework/pull/2903.diff","patch_url":"https://github.com/aspnet/EntityFramework/pull/2903.patch"},"body":"In the common case where original values are tracked eagerly for all properties this change takes the query value buffer and uses it directly as the original values store. This essentially eliminates the cost of creating the original values snapshot, although snapshot of relationship state still takes time.\r\n\r\nIn doing this work it became apparent that sometimes values in the ValueBuffer are not of the correct type--notably for enum values. This caused problems for DetectChanges since the values were of different types and therefore were flagged as different even when no change had been made. To fix this the ValueBuffer obtained from GetValues is now post-processed to convert values as necessary. Currently this is only for enums, but in the future it could be used for any type conversion. Since values in the ValueBufferare now always of the correct type even when GetValues is used it means that the conversion code in the materializer can be removed."},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/133578242","html_url":"https://github.com/aspnet/EntityFramework/pull/2903#issuecomment-133578242","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2903","id":133578242,"user":{"login":"anpete","id":1210944,"avatar_url":"https://avatars.githubusercontent.com/u/1210944?v=3","gravatar_id":"","url":"https://api.github.com/users/anpete","html_url":"https://github.com/anpete","followers_url":"https://api.github.com/users/anpete/followers","following_url":"https://api.github.com/users/anpete/following{/other_user}","gists_url":"https://api.github.com/users/anpete/gists{/gist_id}","starred_url":"https://api.github.com/users/anpete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anpete/subscriptions","organizations_url":"https://api.github.com/users/anpete/orgs","repos_url":"https://api.github.com/users/anpete/repos","events_url":"https://api.github.com/users/anpete/events{/privacy}","received_events_url":"https://api.github.com/users/anpete/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T22:17:18Z","updated_at":"2015-08-21T22:17:18Z","body":":shipit: "}}