{"action":"created","comment":{"url":"https://api.github.com/repos/OData/odata.net/pulls/comments/78732539","id":78732539,"diff_hunk":"@@ -86,8 +86,9 @@ internal static void VerifyObserverNotPresent<T>(object oec, string sourceProper\n \n             if (typedCollection.Observer != null)\n             {\n-                throw new InvalidOperationException(Strings.DataBinding_CollectionPropertySetterValueHasObserver(sourceProperty, sourceType));","path":"WCFDataService/Client/System/Data/Services/Client/Binding/BindingUtils.cs","position":21,"original_position":21,"commit_id":"78fc68984619e2e05fcd42ed3d5b728040a0fef4","original_commit_id":"78fc68984619e2e05fcd42ed3d5b728040a0fef4","user":{"login":"uffelauesen","id":11189938,"avatar_url":"https://avatars.githubusercontent.com/u/11189938?v=3","gravatar_id":"","url":"https://api.github.com/users/uffelauesen","html_url":"https://github.com/uffelauesen","followers_url":"https://api.github.com/users/uffelauesen/followers","following_url":"https://api.github.com/users/uffelauesen/following{/other_user}","gists_url":"https://api.github.com/users/uffelauesen/gists{/gist_id}","starred_url":"https://api.github.com/users/uffelauesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uffelauesen/subscriptions","organizations_url":"https://api.github.com/users/uffelauesen/orgs","repos_url":"https://api.github.com/users/uffelauesen/repos","events_url":"https://api.github.com/users/uffelauesen/events{/privacy}","received_events_url":"https://api.github.com/users/uffelauesen/received_events","type":"User","site_admin":false},"body":"I'll add this: If ProxyBackingFieldNamingConvention is None we will throw as always.","created_at":"2016-09-14T11:43:43Z","updated_at":"2016-09-14T11:43:43Z","html_url":"https://github.com/OData/odata.net/pull/663#discussion_r78732539","pull_request_url":"https://api.github.com/repos/OData/odata.net/pulls/663","_links":{"self":{"href":"https://api.github.com/repos/OData/odata.net/pulls/comments/78732539"},"html":{"href":"https://github.com/OData/odata.net/pull/663#discussion_r78732539"},"pull_request":{"href":"https://api.github.com/repos/OData/odata.net/pulls/663"}}},"pull_request":{"url":"https://api.github.com/repos/OData/odata.net/pulls/663","id":80252298,"html_url":"https://github.com/OData/odata.net/pull/663","diff_url":"https://github.com/OData/odata.net/pull/663.diff","patch_url":"https://github.com/OData/odata.net/pull/663.patch","issue_url":"https://api.github.com/repos/OData/odata.net/issues/663","number":663,"state":"open","locked":false,"title":"Performance: Implemented support for peeking backing field values beh…","user":{"login":"uffelauesen","id":11189938,"avatar_url":"https://avatars.githubusercontent.com/u/11189938?v=3","gravatar_id":"","url":"https://api.github.com/users/uffelauesen","html_url":"https://github.com/uffelauesen","followers_url":"https://api.github.com/users/uffelauesen/followers","following_url":"https://api.github.com/users/uffelauesen/following{/other_user}","gists_url":"https://api.github.com/users/uffelauesen/gists{/gist_id}","starred_url":"https://api.github.com/users/uffelauesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uffelauesen/subscriptions","organizations_url":"https://api.github.com/users/uffelauesen/orgs","repos_url":"https://api.github.com/users/uffelauesen/repos","events_url":"https://api.github.com/users/uffelauesen/events{/privacy}","received_events_url":"https://api.github.com/users/uffelauesen/received_events","type":"User","site_admin":false},"body":"### Issues\r\n*This pull request fixes issue #662 .*  \r\nThe performance numbers given in the issue report will be improved by this fix an a lazy initialized proxy (DSC types). The same figures now looks like this:\r\n\r\n> ---This Fix + Lazy Initialized Proxy\r\n2,9207813 seconds. Reader (materialize=True). Count=50000\r\n2,982213 seconds. DataServiceCollection (trackingMode=None, mergeOption=NoTracking). Count=50000\r\n4,1284593 seconds. DataServiceCollection (trackingMode=None, mergeOption=OverwriteChanges). Count=50000\r\n4,0677041 seconds. DataServiceCollection (trackingMode=None, mergeOption=PreserveChanges). Count=50000\r\n4,682246 seconds. DataServiceCollection (trackingMode=None, mergeOption=AppendOnly). Count=50000\r\n4,2958479 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=NoTracking). Count=50000\r\n4,4394158 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=OverwriteChanges). Count=50000\r\n4,5020407 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=PreserveChanges). Count=50000\r\n**5,0603643** seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=AppendOnly). Count=50000\r\n\r\nNow even with a standard proxy without lazy initialization - you still get a performance boost - the figures is...\r\n\r\n> --- This Fix + Std. Proxy\r\n4,6663771 seconds. Reader (materialize=True). Count=50000\r\n5,6179793 seconds. DataServiceCollection (trackingMode=None, mergeOption=NoTracking). Count=50000\r\n7,1251904 seconds. DataServiceCollection (trackingMode=None, mergeOption=OverwriteChanges). Count=50000\r\n7,2962285 seconds. DataServiceCollection (trackingMode=None, mergeOption=PreserveChanges). Count=50000\r\n8,9586409 seconds. DataServiceCollection (trackingMode=None, mergeOption=AppendOnly). Count=50000\r\n43,1957756 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=NoTracking). Count=50000\r\n42,5817499 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=OverwriteChanges). Count=50000\r\n44,0261132 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=PreserveChanges). Count=50000\r\n**42,906094** seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=AppendOnly). Count=50000\r\n\r\nAs a comparison here are the figures from WCF DS 5.7.0:\r\n\r\n> --- 5.7.0 - Std. Proxy\r\n4,9716813 seconds. Reader (materialize=True). Count=50000\r\n30,3644236 seconds. DataServiceCollection (trackingMode=None, mergeOption=NoTracking). Count=50000\r\n34,3648641 seconds. DataServiceCollection (trackingMode=None, mergeOption=OverwriteChanges). Count=50000\r\n34,9383197 seconds. DataServiceCollection (trackingMode=None, mergeOption=PreserveChanges). Count=50000\r\n35,4712147 seconds. DataServiceCollection (trackingMode=None, mergeOption=AppendOnly). Count=50000\r\n163,8808292 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=NoTracking). Count=50000\r\n166,7953488 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=OverwriteChanges). Count=50000\r\n164,3714063 seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=PreserveChanges). Count=50000\r\n**166,4116248** seconds. DataServiceCollection (trackingMode=AutoChangeTracking, mergeOption=AppendOnly). Count=50000\r\n\r\n\r\n### Description\r\n*Implemented peeking backing field values. Removed some performance heavy redundant validation checks.*\r\n\r\nIt will work with optimal performance and be back wards compatible with existing client code. For the best in performance please use a proxy with Lazy initialized DataServiceCollection<> typed properties in this form:\r\n\r\n`        private global::System.Data.Services.Client.DataServiceCollection<RecordContact> __Records = null;\r\n        private global::System.Data.Services.Client.DataServiceCollection<RecordContact> _Records\r\n        {\r\n            get\r\n            {\r\n                if (__Records == null)\r\n                    Records = new global::System.Data.Services.Client.DataServiceCollection<RecordContact>(null, global::System.Data.Services.Client.TrackingMode.None);\r\n                return __Records;\r\n            } set\r\n            {\r\n                __Records = value;\r\n            }\r\n        }\r\n`\r\nAn existing proxy could be easily transformed to this lazy initialized form by a RegEx replacement on the Reference.cs file like this:\r\n\r\n`                string pattern = @\"private (.+) _(.+) = new global::System.Data.Services.Client.DataServiceCollection\\<(.+)\\>\\(null, global::System.Data.Services.Client.TrackingMode.None\\);\";\r\n                string replacer = \"private $1 __$2 = null; private $1 _$2 { get { if (__$2 == null) $2 = new $1(null, global::System.Data.Services.Client.TrackingMode.None); return __$2; } set { __$2 = value; } }\";\r\n                Regex.Replace(original, pattern, replacer);\r\n`\r\n\r\n### Checklist (Uncheck if it is not completed)\r\n- [  ] Test cases added\r\n- [  ] Build and test with one-click build and test script passed\r\n\r\n### Additional work necessary\r\n*To fully utilize the performance gains here, this change should go hand in hand with a change to the standard CodeGen generated proxy. I propose to do this in the OData Connected Service VSIX. It can be done by a simple RegEx on the already generated V3 reference.cs file from DataSvcUtil. On V4 you have the TT approach where it can be fixed more direct.*\r\n\r\n…ind lazy initialized properties to avoid accidental initializing/construction during GET operations.","created_at":"2016-08-05T14:28:50Z","updated_at":"2016-09-14T11:43:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d45c9504a31fd4b9eb8511acfd8b3c788b526ef","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OData/odata.net/pulls/663/commits","review_comments_url":"https://api.github.com/repos/OData/odata.net/pulls/663/comments","review_comment_url":"https://api.github.com/repos/OData/odata.net/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OData/odata.net/issues/663/comments","statuses_url":"https://api.github.com/repos/OData/odata.net/statuses/78fc68984619e2e05fcd42ed3d5b728040a0fef4","head":{"label":"uffelauesen:V3Client-HandleLazyInitializedProxyProperties","ref":"V3Client-HandleLazyInitializedProxyProperties","sha":"78fc68984619e2e05fcd42ed3d5b728040a0fef4","user":{"login":"uffelauesen","id":11189938,"avatar_url":"https://avatars.githubusercontent.com/u/11189938?v=3","gravatar_id":"","url":"https://api.github.com/users/uffelauesen","html_url":"https://github.com/uffelauesen","followers_url":"https://api.github.com/users/uffelauesen/followers","following_url":"https://api.github.com/users/uffelauesen/following{/other_user}","gists_url":"https://api.github.com/users/uffelauesen/gists{/gist_id}","starred_url":"https://api.github.com/users/uffelauesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uffelauesen/subscriptions","organizations_url":"https://api.github.com/users/uffelauesen/orgs","repos_url":"https://api.github.com/users/uffelauesen/repos","events_url":"https://api.github.com/users/uffelauesen/events{/privacy}","received_events_url":"https://api.github.com/users/uffelauesen/received_events","type":"User","site_admin":false},"repo":{"id":64662357,"name":"odata.net","full_name":"uffelauesen/odata.net","owner":{"login":"uffelauesen","id":11189938,"avatar_url":"https://avatars.githubusercontent.com/u/11189938?v=3","gravatar_id":"","url":"https://api.github.com/users/uffelauesen","html_url":"https://github.com/uffelauesen","followers_url":"https://api.github.com/users/uffelauesen/followers","following_url":"https://api.github.com/users/uffelauesen/following{/other_user}","gists_url":"https://api.github.com/users/uffelauesen/gists{/gist_id}","starred_url":"https://api.github.com/users/uffelauesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uffelauesen/subscriptions","organizations_url":"https://api.github.com/users/uffelauesen/orgs","repos_url":"https://api.github.com/users/uffelauesen/repos","events_url":"https://api.github.com/users/uffelauesen/events{/privacy}","received_events_url":"https://api.github.com/users/uffelauesen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uffelauesen/odata.net","description":"ODataLib: Open Data Protocol - .NET/Silverlight/WP8.1 Libraries and Frameworks","fork":true,"url":"https://api.github.com/repos/uffelauesen/odata.net","forks_url":"https://api.github.com/repos/uffelauesen/odata.net/forks","keys_url":"https://api.github.com/repos/uffelauesen/odata.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uffelauesen/odata.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uffelauesen/odata.net/teams","hooks_url":"https://api.github.com/repos/uffelauesen/odata.net/hooks","issue_events_url":"https://api.github.com/repos/uffelauesen/odata.net/issues/events{/number}","events_url":"https://api.github.com/repos/uffelauesen/odata.net/events","assignees_url":"https://api.github.com/repos/uffelauesen/odata.net/assignees{/user}","branches_url":"https://api.github.com/repos/uffelauesen/odata.net/branches{/branch}","tags_url":"https://api.github.com/repos/uffelauesen/odata.net/tags","blobs_url":"https://api.github.com/repos/uffelauesen/odata.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uffelauesen/odata.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uffelauesen/odata.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/uffelauesen/odata.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uffelauesen/odata.net/statuses/{sha}","languages_url":"https://api.github.com/repos/uffelauesen/odata.net/languages","stargazers_url":"https://api.github.com/repos/uffelauesen/odata.net/stargazers","contributors_url":"https://api.github.com/repos/uffelauesen/odata.net/contributors","subscribers_url":"https://api.github.com/repos/uffelauesen/odata.net/subscribers","subscription_url":"https://api.github.com/repos/uffelauesen/odata.net/subscription","commits_url":"https://api.github.com/repos/uffelauesen/odata.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/uffelauesen/odata.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/uffelauesen/odata.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/uffelauesen/odata.net/issues/comments{/number}","contents_url":"https://api.github.com/repos/uffelauesen/odata.net/contents/{+path}","compare_url":"https://api.github.com/repos/uffelauesen/odata.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uffelauesen/odata.net/merges","archive_url":"https://api.github.com/repos/uffelauesen/odata.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uffelauesen/odata.net/downloads","issues_url":"https://api.github.com/repos/uffelauesen/odata.net/issues{/number}","pulls_url":"https://api.github.com/repos/uffelauesen/odata.net/pulls{/number}","milestones_url":"https://api.github.com/repos/uffelauesen/odata.net/milestones{/number}","notifications_url":"https://api.github.com/repos/uffelauesen/odata.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uffelauesen/odata.net/labels{/name}","releases_url":"https://api.github.com/repos/uffelauesen/odata.net/releases{/id}","deployments_url":"https://api.github.com/repos/uffelauesen/odata.net/deployments","created_at":"2016-08-01T11:43:49Z","updated_at":"2016-08-01T11:44:11Z","pushed_at":"2016-09-14T11:08:14Z","git_url":"git://github.com/uffelauesen/odata.net.git","ssh_url":"git@github.com:uffelauesen/odata.net.git","clone_url":"https://github.com/uffelauesen/odata.net.git","svn_url":"https://github.com/uffelauesen/odata.net","homepage":"http://odata.github.io/odata.net","size":43933,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"ODataV4-6.x"}},"base":{"label":"OData:ODATAV3","ref":"ODATAV3","sha":"f1934b38346cc328bfdd2db9757c0be2c7c16942","user":{"login":"OData","id":916520,"avatar_url":"https://avatars.githubusercontent.com/u/916520?v=3","gravatar_id":"","url":"https://api.github.com/users/OData","html_url":"https://github.com/OData","followers_url":"https://api.github.com/users/OData/followers","following_url":"https://api.github.com/users/OData/following{/other_user}","gists_url":"https://api.github.com/users/OData/gists{/gist_id}","starred_url":"https://api.github.com/users/OData/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OData/subscriptions","organizations_url":"https://api.github.com/users/OData/orgs","repos_url":"https://api.github.com/users/OData/repos","events_url":"https://api.github.com/users/OData/events{/privacy}","received_events_url":"https://api.github.com/users/OData/received_events","type":"Organization","site_admin":false},"repo":{"id":23308338,"name":"odata.net","full_name":"OData/odata.net","owner":{"login":"OData","id":916520,"avatar_url":"https://avatars.githubusercontent.com/u/916520?v=3","gravatar_id":"","url":"https://api.github.com/users/OData","html_url":"https://github.com/OData","followers_url":"https://api.github.com/users/OData/followers","following_url":"https://api.github.com/users/OData/following{/other_user}","gists_url":"https://api.github.com/users/OData/gists{/gist_id}","starred_url":"https://api.github.com/users/OData/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OData/subscriptions","organizations_url":"https://api.github.com/users/OData/orgs","repos_url":"https://api.github.com/users/OData/repos","events_url":"https://api.github.com/users/OData/events{/privacy}","received_events_url":"https://api.github.com/users/OData/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OData/odata.net","description":"ODataLib: Open Data Protocol - .NET/Silverlight/WP8.1 Libraries and Frameworks","fork":false,"url":"https://api.github.com/repos/OData/odata.net","forks_url":"https://api.github.com/repos/OData/odata.net/forks","keys_url":"https://api.github.com/repos/OData/odata.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OData/odata.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OData/odata.net/teams","hooks_url":"https://api.github.com/repos/OData/odata.net/hooks","issue_events_url":"https://api.github.com/repos/OData/odata.net/issues/events{/number}","events_url":"https://api.github.com/repos/OData/odata.net/events","assignees_url":"https://api.github.com/repos/OData/odata.net/assignees{/user}","branches_url":"https://api.github.com/repos/OData/odata.net/branches{/branch}","tags_url":"https://api.github.com/repos/OData/odata.net/tags","blobs_url":"https://api.github.com/repos/OData/odata.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OData/odata.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OData/odata.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/OData/odata.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OData/odata.net/statuses/{sha}","languages_url":"https://api.github.com/repos/OData/odata.net/languages","stargazers_url":"https://api.github.com/repos/OData/odata.net/stargazers","contributors_url":"https://api.github.com/repos/OData/odata.net/contributors","subscribers_url":"https://api.github.com/repos/OData/odata.net/subscribers","subscription_url":"https://api.github.com/repos/OData/odata.net/subscription","commits_url":"https://api.github.com/repos/OData/odata.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/OData/odata.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/OData/odata.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/OData/odata.net/issues/comments{/number}","contents_url":"https://api.github.com/repos/OData/odata.net/contents/{+path}","compare_url":"https://api.github.com/repos/OData/odata.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OData/odata.net/merges","archive_url":"https://api.github.com/repos/OData/odata.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OData/odata.net/downloads","issues_url":"https://api.github.com/repos/OData/odata.net/issues{/number}","pulls_url":"https://api.github.com/repos/OData/odata.net/pulls{/number}","milestones_url":"https://api.github.com/repos/OData/odata.net/milestones{/number}","notifications_url":"https://api.github.com/repos/OData/odata.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OData/odata.net/labels{/name}","releases_url":"https://api.github.com/repos/OData/odata.net/releases{/id}","deployments_url":"https://api.github.com/repos/OData/odata.net/deployments","created_at":"2014-08-25T09:15:23Z","updated_at":"2016-09-09T15:25:59Z","pushed_at":"2016-09-14T11:08:14Z","git_url":"git://github.com/OData/odata.net.git","ssh_url":"git@github.com:OData/odata.net.git","clone_url":"https://github.com/OData/odata.net.git","svn_url":"https://github.com/OData/odata.net","homepage":"http://odata.github.io/odata.net","size":46276,"stargazers_count":186,"watchers_count":186,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":117,"mirror_url":null,"open_issues_count":262,"forks":117,"open_issues":262,"watchers":186,"default_branch":"ODataV4-6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/OData/odata.net/pulls/663"},"html":{"href":"https://github.com/OData/odata.net/pull/663"},"issue":{"href":"https://api.github.com/repos/OData/odata.net/issues/663"},"comments":{"href":"https://api.github.com/repos/OData/odata.net/issues/663/comments"},"review_comments":{"href":"https://api.github.com/repos/OData/odata.net/pulls/663/comments"},"review_comment":{"href":"https://api.github.com/repos/OData/odata.net/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OData/odata.net/pulls/663/commits"},"statuses":{"href":"https://api.github.com/repos/OData/odata.net/statuses/78fc68984619e2e05fcd42ed3d5b728040a0fef4"}}}}
{"actor":{"display_login":"uffelauesen"}}