{"action":"created","comment":{"url":"https://api.github.com/repos/ayende/ravendb/pulls/comments/80927651","pull_request_review_id":1945571,"id":80927651,"diff_hunk":"@@ -15,32 +16,70 @@\n using Sparrow.Json;\n using Sparrow.Json.Parsing;\n using DocumentInfo = Raven.Client.Documents.InMemoryDocumentSessionOperations.DocumentInfo;\n+using System.Text;\n \n namespace Raven.Client.Documents\n {\n     public class EntityToBlittable\n     {\n-        private readonly IDocumentStore documentStore;\n-        private readonly JsonOperationContext _context;\n+        private readonly InMemoryDocumentSessionOperations _session;\n \n-        /// <summary>\n-        /// All the listeners for this session\n-        /// </summary>\n-        public EntityToBlittable(IDocumentStore documentStore, JsonOperationContext context)\n+        public MemoryStream OperationsMemoryStream\n         {\n-            this.documentStore = documentStore;\n-            _context = context;\n+            get\n+            {\n+                if (_stream == null)\n+                {\n+                    _stream = new MemoryStream(4 * 1024);\n+                }\n+                return _stream;\n+            }\n         }\n-        public readonly Dictionary<object, Dictionary<string, JToken>> MissingDictionary = new Dictionary<object, Dictionary<string, JToken>>(ObjectReferenceEqualityComparer<object>.Default);\n \n-        public BlittableJsonReaderObject ConvertEntityToBlittable(string id, object entity, DocumentInfo documentInfo)\n+        private MemoryStream _stream;\n+\n+\n+        public StreamReader _streamReader;\n+\n+        public StreamReader StreamReader\n         {\n-           return GetObjectAsBlittable(entity, documentInfo, _context); \n+            get\n+            {\n+                if (_streamReader == null)","path":"src/Raven.Client/Documents/EntityToBlittable.cs","position":52,"original_position":52,"commit_id":"1326694099c530885bd0ca175429e22f72d55543","original_commit_id":"1326694099c530885bd0ca175429e22f72d55543","user":{"login":"ayende","id":116915,"avatar_url":"https://avatars.githubusercontent.com/u/116915?v=3","gravatar_id":"","url":"https://api.github.com/users/ayende","html_url":"https://github.com/ayende","followers_url":"https://api.github.com/users/ayende/followers","following_url":"https://api.github.com/users/ayende/following{/other_user}","gists_url":"https://api.github.com/users/ayende/gists{/gist_id}","starred_url":"https://api.github.com/users/ayende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayende/subscriptions","organizations_url":"https://api.github.com/users/ayende/orgs","repos_url":"https://api.github.com/users/ayende/repos","events_url":"https://api.github.com/users/ayende/events{/privacy}","received_events_url":"https://api.github.com/users/ayende/received_events","type":"User","site_admin":false},"body":"You are setting a lot of variables to the defaults, why? It would be easier to do `new StreamWriter()`","created_at":"2016-09-28T14:21:00Z","updated_at":"2016-09-28T14:21:00Z","html_url":"https://github.com/ayende/ravendb/pull/4502#discussion_r80927651","pull_request_url":"https://api.github.com/repos/ayende/ravendb/pulls/4502","_links":{"self":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/comments/80927651"},"html":{"href":"https://github.com/ayende/ravendb/pull/4502#discussion_r80927651"},"pull_request":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/4502"}}},"pull_request":{"url":"https://api.github.com/repos/ayende/ravendb/pulls/4502","id":87123768,"html_url":"https://github.com/ayende/ravendb/pull/4502","diff_url":"https://github.com/ayende/ravendb/pull/4502.diff","patch_url":"https://github.com/ayende/ravendb/pull/4502.patch","issue_url":"https://api.github.com/repos/ayende/ravendb/issues/4502","number":4502,"state":"open","locked":false,"title":"Improved client side Blittable serialization/deserialization memory usage","user":{"login":"maximburyak","id":6830980,"avatar_url":"https://avatars.githubusercontent.com/u/6830980?v=3","gravatar_id":"","url":"https://api.github.com/users/maximburyak","html_url":"https://github.com/maximburyak","followers_url":"https://api.github.com/users/maximburyak/followers","following_url":"https://api.github.com/users/maximburyak/following{/other_user}","gists_url":"https://api.github.com/users/maximburyak/gists{/gist_id}","starred_url":"https://api.github.com/users/maximburyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximburyak/subscriptions","organizations_url":"https://api.github.com/users/maximburyak/orgs","repos_url":"https://api.github.com/users/maximburyak/repos","events_url":"https://api.github.com/users/maximburyak/events{/privacy}","received_events_url":"https://api.github.com/users/maximburyak/received_events","type":"User","site_admin":false},"body":"in session","created_at":"2016-09-28T13:50:02Z","updated_at":"2016-09-28T14:22:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe5a4031308587a7523fd98c0536c2fafc3bc742","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ayende/ravendb/pulls/4502/commits","review_comments_url":"https://api.github.com/repos/ayende/ravendb/pulls/4502/comments","review_comment_url":"https://api.github.com/repos/ayende/ravendb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ayende/ravendb/issues/4502/comments","statuses_url":"https://api.github.com/repos/ayende/ravendb/statuses/1326694099c530885bd0ca175429e22f72d55543","head":{"label":"maximburyak:RavenDB-5255","ref":"RavenDB-5255","sha":"1326694099c530885bd0ca175429e22f72d55543","user":{"login":"maximburyak","id":6830980,"avatar_url":"https://avatars.githubusercontent.com/u/6830980?v=3","gravatar_id":"","url":"https://api.github.com/users/maximburyak","html_url":"https://github.com/maximburyak","followers_url":"https://api.github.com/users/maximburyak/followers","following_url":"https://api.github.com/users/maximburyak/following{/other_user}","gists_url":"https://api.github.com/users/maximburyak/gists{/gist_id}","starred_url":"https://api.github.com/users/maximburyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximburyak/subscriptions","organizations_url":"https://api.github.com/users/maximburyak/orgs","repos_url":"https://api.github.com/users/maximburyak/repos","events_url":"https://api.github.com/users/maximburyak/events{/privacy}","received_events_url":"https://api.github.com/users/maximburyak/received_events","type":"User","site_admin":false},"repo":{"id":17337755,"name":"ravendb","full_name":"maximburyak/ravendb","owner":{"login":"maximburyak","id":6830980,"avatar_url":"https://avatars.githubusercontent.com/u/6830980?v=3","gravatar_id":"","url":"https://api.github.com/users/maximburyak","html_url":"https://github.com/maximburyak","followers_url":"https://api.github.com/users/maximburyak/followers","following_url":"https://api.github.com/users/maximburyak/following{/other_user}","gists_url":"https://api.github.com/users/maximburyak/gists{/gist_id}","starred_url":"https://api.github.com/users/maximburyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximburyak/subscriptions","organizations_url":"https://api.github.com/users/maximburyak/orgs","repos_url":"https://api.github.com/users/maximburyak/repos","events_url":"https://api.github.com/users/maximburyak/events{/privacy}","received_events_url":"https://api.github.com/users/maximburyak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maximburyak/ravendb","description":"A linq enabled document database for .NET","fork":true,"url":"https://api.github.com/repos/maximburyak/ravendb","forks_url":"https://api.github.com/repos/maximburyak/ravendb/forks","keys_url":"https://api.github.com/repos/maximburyak/ravendb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maximburyak/ravendb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maximburyak/ravendb/teams","hooks_url":"https://api.github.com/repos/maximburyak/ravendb/hooks","issue_events_url":"https://api.github.com/repos/maximburyak/ravendb/issues/events{/number}","events_url":"https://api.github.com/repos/maximburyak/ravendb/events","assignees_url":"https://api.github.com/repos/maximburyak/ravendb/assignees{/user}","branches_url":"https://api.github.com/repos/maximburyak/ravendb/branches{/branch}","tags_url":"https://api.github.com/repos/maximburyak/ravendb/tags","blobs_url":"https://api.github.com/repos/maximburyak/ravendb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maximburyak/ravendb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maximburyak/ravendb/git/refs{/sha}","trees_url":"https://api.github.com/repos/maximburyak/ravendb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maximburyak/ravendb/statuses/{sha}","languages_url":"https://api.github.com/repos/maximburyak/ravendb/languages","stargazers_url":"https://api.github.com/repos/maximburyak/ravendb/stargazers","contributors_url":"https://api.github.com/repos/maximburyak/ravendb/contributors","subscribers_url":"https://api.github.com/repos/maximburyak/ravendb/subscribers","subscription_url":"https://api.github.com/repos/maximburyak/ravendb/subscription","commits_url":"https://api.github.com/repos/maximburyak/ravendb/commits{/sha}","git_commits_url":"https://api.github.com/repos/maximburyak/ravendb/git/commits{/sha}","comments_url":"https://api.github.com/repos/maximburyak/ravendb/comments{/number}","issue_comment_url":"https://api.github.com/repos/maximburyak/ravendb/issues/comments{/number}","contents_url":"https://api.github.com/repos/maximburyak/ravendb/contents/{+path}","compare_url":"https://api.github.com/repos/maximburyak/ravendb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maximburyak/ravendb/merges","archive_url":"https://api.github.com/repos/maximburyak/ravendb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maximburyak/ravendb/downloads","issues_url":"https://api.github.com/repos/maximburyak/ravendb/issues{/number}","pulls_url":"https://api.github.com/repos/maximburyak/ravendb/pulls{/number}","milestones_url":"https://api.github.com/repos/maximburyak/ravendb/milestones{/number}","notifications_url":"https://api.github.com/repos/maximburyak/ravendb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maximburyak/ravendb/labels{/name}","releases_url":"https://api.github.com/repos/maximburyak/ravendb/releases{/id}","deployments_url":"https://api.github.com/repos/maximburyak/ravendb/deployments","created_at":"2014-03-02T13:00:09Z","updated_at":"2015-05-04T09:42:40Z","pushed_at":"2016-09-28T13:48:19Z","git_url":"git://github.com/maximburyak/ravendb.git","ssh_url":"git@github.com:maximburyak/ravendb.git","clone_url":"https://github.com/maximburyak/ravendb.git","svn_url":"https://github.com/maximburyak/ravendb","homepage":"http://ayende.com/Blog/","size":373363,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ayende:v4.0","ref":"v4.0","sha":"24c0565d8ee72332c0ffa9d7472209121552d0b7","user":{"login":"ayende","id":116915,"avatar_url":"https://avatars.githubusercontent.com/u/116915?v=3","gravatar_id":"","url":"https://api.github.com/users/ayende","html_url":"https://github.com/ayende","followers_url":"https://api.github.com/users/ayende/followers","following_url":"https://api.github.com/users/ayende/following{/other_user}","gists_url":"https://api.github.com/users/ayende/gists{/gist_id}","starred_url":"https://api.github.com/users/ayende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayende/subscriptions","organizations_url":"https://api.github.com/users/ayende/orgs","repos_url":"https://api.github.com/users/ayende/repos","events_url":"https://api.github.com/users/ayende/events{/privacy}","received_events_url":"https://api.github.com/users/ayende/received_events","type":"User","site_admin":false},"repo":{"id":904641,"name":"ravendb","full_name":"ayende/ravendb","owner":{"login":"ayende","id":116915,"avatar_url":"https://avatars.githubusercontent.com/u/116915?v=3","gravatar_id":"","url":"https://api.github.com/users/ayende","html_url":"https://github.com/ayende","followers_url":"https://api.github.com/users/ayende/followers","following_url":"https://api.github.com/users/ayende/following{/other_user}","gists_url":"https://api.github.com/users/ayende/gists{/gist_id}","starred_url":"https://api.github.com/users/ayende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayende/subscriptions","organizations_url":"https://api.github.com/users/ayende/orgs","repos_url":"https://api.github.com/users/ayende/repos","events_url":"https://api.github.com/users/ayende/events{/privacy}","received_events_url":"https://api.github.com/users/ayende/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ayende/ravendb","description":"A linq enabled document database for .NET","fork":true,"url":"https://api.github.com/repos/ayende/ravendb","forks_url":"https://api.github.com/repos/ayende/ravendb/forks","keys_url":"https://api.github.com/repos/ayende/ravendb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ayende/ravendb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ayende/ravendb/teams","hooks_url":"https://api.github.com/repos/ayende/ravendb/hooks","issue_events_url":"https://api.github.com/repos/ayende/ravendb/issues/events{/number}","events_url":"https://api.github.com/repos/ayende/ravendb/events","assignees_url":"https://api.github.com/repos/ayende/ravendb/assignees{/user}","branches_url":"https://api.github.com/repos/ayende/ravendb/branches{/branch}","tags_url":"https://api.github.com/repos/ayende/ravendb/tags","blobs_url":"https://api.github.com/repos/ayende/ravendb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ayende/ravendb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ayende/ravendb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ayende/ravendb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ayende/ravendb/statuses/{sha}","languages_url":"https://api.github.com/repos/ayende/ravendb/languages","stargazers_url":"https://api.github.com/repos/ayende/ravendb/stargazers","contributors_url":"https://api.github.com/repos/ayende/ravendb/contributors","subscribers_url":"https://api.github.com/repos/ayende/ravendb/subscribers","subscription_url":"https://api.github.com/repos/ayende/ravendb/subscription","commits_url":"https://api.github.com/repos/ayende/ravendb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ayende/ravendb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ayende/ravendb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ayende/ravendb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ayende/ravendb/contents/{+path}","compare_url":"https://api.github.com/repos/ayende/ravendb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ayende/ravendb/merges","archive_url":"https://api.github.com/repos/ayende/ravendb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ayende/ravendb/downloads","issues_url":"https://api.github.com/repos/ayende/ravendb/issues{/number}","pulls_url":"https://api.github.com/repos/ayende/ravendb/pulls{/number}","milestones_url":"https://api.github.com/repos/ayende/ravendb/milestones{/number}","notifications_url":"https://api.github.com/repos/ayende/ravendb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ayende/ravendb/labels{/name}","releases_url":"https://api.github.com/repos/ayende/ravendb/releases{/id}","deployments_url":"https://api.github.com/repos/ayende/ravendb/deployments","created_at":"2010-09-12T05:30:13Z","updated_at":"2016-09-22T21:46:02Z","pushed_at":"2016-09-28T13:50:02Z","git_url":"git://github.com/ayende/ravendb.git","ssh_url":"git@github.com:ayende/ravendb.git","clone_url":"https://github.com/ayende/ravendb.git","svn_url":"https://github.com/ayende/ravendb","homepage":"http://ayende.com/Blog/","size":502036,"stargazers_count":285,"watchers_count":285,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":146,"mirror_url":null,"open_issues_count":2,"forks":146,"open_issues":2,"watchers":285,"default_branch":"v3.5"}},"_links":{"self":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/4502"},"html":{"href":"https://github.com/ayende/ravendb/pull/4502"},"issue":{"href":"https://api.github.com/repos/ayende/ravendb/issues/4502"},"comments":{"href":"https://api.github.com/repos/ayende/ravendb/issues/4502/comments"},"review_comments":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/4502/comments"},"review_comment":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ayende/ravendb/pulls/4502/commits"},"statuses":{"href":"https://api.github.com/repos/ayende/ravendb/statuses/1326694099c530885bd0ca175429e22f72d55543"}}}}
{"actor":{"display_login":"ayende"}}