{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6301","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6301/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6301/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6301/events","html_url":"https://github.com/hazelcast/hazelcast/pull/6301","id":108659540,"number":6301,"title":"Don't convert backup operation to `Data` before serializing `Backup` if there is only one backup for preventing unnecessary temporary memory allocation and copy","user":{"login":"serkan-ozal","id":3143425,"avatar_url":"https://avatars.githubusercontent.com/u/3143425?v=3","gravatar_id":"","url":"https://api.github.com/users/serkan-ozal","html_url":"https://github.com/serkan-ozal","followers_url":"https://api.github.com/users/serkan-ozal/followers","following_url":"https://api.github.com/users/serkan-ozal/following{/other_user}","gists_url":"https://api.github.com/users/serkan-ozal/gists{/gist_id}","starred_url":"https://api.github.com/users/serkan-ozal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serkan-ozal/subscriptions","organizations_url":"https://api.github.com/users/serkan-ozal/orgs","repos_url":"https://api.github.com/users/serkan-ozal/repos","events_url":"https://api.github.com/users/serkan-ozal/events{/privacy}","received_events_url":"https://api.github.com/users/serkan-ozal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"eb6420"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":157,"closed_issues":531,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2015-10-08T14:45:28Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-09-28T13:37:36Z","updated_at":"2015-10-08T15:14:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6301","html_url":"https://github.com/hazelcast/hazelcast/pull/6301","diff_url":"https://github.com/hazelcast/hazelcast/pull/6301.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/6301.patch"},"body":"By default, Hazelcast uses only one backup.\r\nIf there is only one backup, backup operation is sent to only one backup node.\r\nIf backup operation is converted to `Data`, there will be these operations as below:\r\n* a temporary memory allocation (`byte[]`) for `Data`\r\n* serialize backup operation to allocated memory\r\n* copy the temporary allocated memory (backup operation data) to output while serializing `Backup`\r\n\r\nIn this flow, there are two redundant operations (allocating temporary memory and copying it to output). So in this case (there is only one backup), we don't convert backup operation to `Data` as temporary before `Backup` is serialized but backup operation is already serialized directly into output without any unnecessary memory allocation and copy when it is used as object inside `Backup`."},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/146575707","html_url":"https://github.com/hazelcast/hazelcast/pull/6301#issuecomment-146575707","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6301","id":146575707,"user":{"login":"ahmetmircik","id":2960360,"avatar_url":"https://avatars.githubusercontent.com/u/2960360?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetmircik","html_url":"https://github.com/ahmetmircik","followers_url":"https://api.github.com/users/ahmetmircik/followers","following_url":"https://api.github.com/users/ahmetmircik/following{/other_user}","gists_url":"https://api.github.com/users/ahmetmircik/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetmircik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetmircik/subscriptions","organizations_url":"https://api.github.com/users/ahmetmircik/orgs","repos_url":"https://api.github.com/users/ahmetmircik/repos","events_url":"https://api.github.com/users/ahmetmircik/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetmircik/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T15:14:28Z","updated_at":"2015-10-08T15:14:28Z","body":"with minor comments and seems mergeable once green :+1: "}}