{"action":"closed","number":4148,"pull_request":{"url":"https://api.github.com/repos/google/flatbuffers/pulls/4148","id":102995374,"html_url":"https://github.com/google/flatbuffers/pull/4148","diff_url":"https://github.com/google/flatbuffers/pull/4148.diff","patch_url":"https://github.com/google/flatbuffers/pull/4148.patch","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/4148","number":4148,"state":"closed","locked":false,"title":"C++ Union Vector","user":{"login":"gbeili","id":24926146,"avatar_url":"https://avatars.githubusercontent.com/u/24926146?v=3","gravatar_id":"","url":"https://api.github.com/users/gbeili","html_url":"https://github.com/gbeili","followers_url":"https://api.github.com/users/gbeili/followers","following_url":"https://api.github.com/users/gbeili/following{/other_user}","gists_url":"https://api.github.com/users/gbeili/gists{/gist_id}","starred_url":"https://api.github.com/users/gbeili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbeili/subscriptions","organizations_url":"https://api.github.com/users/gbeili/orgs","repos_url":"https://api.github.com/users/gbeili/repos","events_url":"https://api.github.com/users/gbeili/events{/privacy}","received_events_url":"https://api.github.com/users/gbeili/received_events","type":"User","site_admin":false},"body":"Currently to have a vector of union in FlatBuffers, unions have to be encapsulated by tables. However, tables have certain overhead, e.g., it has to keep vtable per table instance, and store offsets instead of actual values for many value types. vtable itself has a few bytes overhead for store the vtable metadata, and the actual indices.\r\n\r\nIn order to minimize the overhead, improve the coding throughput and reduce the wire format size, it would be nice to support the \"vector of union\" feature, without paying the one table per union cost.\r\n\r\nWouter pointed out that being non-invasive to the existing coding format is one of the key issues for implementing this feature.\r\n\r\nWe agreed on making the vector of union into 2 parallel fields: a vector of types and a vector of values. This will not break any existing encoding and has efficient storage. The downside is, iterating the vector has more work, as there are two underlying vectors to read from instead of just one.\r\n\r\nThis PR only adds the feature to C++. There will be a followup CL that adds JSON support. Supports of other programming languages will be added later.\r\n\r\nNote this is the restoration of PR https://github.com/google/flatbuffers/pull/4143, see all the context / comments there.","created_at":"2017-01-24T20:18:16Z","updated_at":"2017-01-24T20:26:02Z","closed_at":"2017-01-24T20:26:02Z","merged_at":null,"merge_commit_sha":"3803f9f66eeb9df243c5d4058e3d9d6dc2870688","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/flatbuffers/pulls/4148/commits","review_comments_url":"https://api.github.com/repos/google/flatbuffers/pulls/4148/comments","review_comment_url":"https://api.github.com/repos/google/flatbuffers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/4148/comments","statuses_url":"https://api.github.com/repos/google/flatbuffers/statuses/68bbe983e9819bcbcd214cf84d73a440863ed6ca","head":{"label":"gbeili:vector_unions","ref":"vector_unions","sha":"68bbe983e9819bcbcd214cf84d73a440863ed6ca","user":{"login":"gbeili","id":24926146,"avatar_url":"https://avatars.githubusercontent.com/u/24926146?v=3","gravatar_id":"","url":"https://api.github.com/users/gbeili","html_url":"https://github.com/gbeili","followers_url":"https://api.github.com/users/gbeili/followers","following_url":"https://api.github.com/users/gbeili/following{/other_user}","gists_url":"https://api.github.com/users/gbeili/gists{/gist_id}","starred_url":"https://api.github.com/users/gbeili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbeili/subscriptions","organizations_url":"https://api.github.com/users/gbeili/orgs","repos_url":"https://api.github.com/users/gbeili/repos","events_url":"https://api.github.com/users/gbeili/events{/privacy}","received_events_url":"https://api.github.com/users/gbeili/received_events","type":"User","site_admin":false},"repo":{"id":78064058,"name":"flatbuffers","full_name":"gbeili/flatbuffers","owner":{"login":"gbeili","id":24926146,"avatar_url":"https://avatars.githubusercontent.com/u/24926146?v=3","gravatar_id":"","url":"https://api.github.com/users/gbeili","html_url":"https://github.com/gbeili","followers_url":"https://api.github.com/users/gbeili/followers","following_url":"https://api.github.com/users/gbeili/following{/other_user}","gists_url":"https://api.github.com/users/gbeili/gists{/gist_id}","starred_url":"https://api.github.com/users/gbeili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbeili/subscriptions","organizations_url":"https://api.github.com/users/gbeili/orgs","repos_url":"https://api.github.com/users/gbeili/repos","events_url":"https://api.github.com/users/gbeili/events{/privacy}","received_events_url":"https://api.github.com/users/gbeili/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gbeili/flatbuffers","description":"Memory Efficient Serialization Library","fork":true,"url":"https://api.github.com/repos/gbeili/flatbuffers","forks_url":"https://api.github.com/repos/gbeili/flatbuffers/forks","keys_url":"https://api.github.com/repos/gbeili/flatbuffers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gbeili/flatbuffers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gbeili/flatbuffers/teams","hooks_url":"https://api.github.com/repos/gbeili/flatbuffers/hooks","issue_events_url":"https://api.github.com/repos/gbeili/flatbuffers/issues/events{/number}","events_url":"https://api.github.com/repos/gbeili/flatbuffers/events","assignees_url":"https://api.github.com/repos/gbeili/flatbuffers/assignees{/user}","branches_url":"https://api.github.com/repos/gbeili/flatbuffers/branches{/branch}","tags_url":"https://api.github.com/repos/gbeili/flatbuffers/tags","blobs_url":"https://api.github.com/repos/gbeili/flatbuffers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gbeili/flatbuffers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gbeili/flatbuffers/git/refs{/sha}","trees_url":"https://api.github.com/repos/gbeili/flatbuffers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gbeili/flatbuffers/statuses/{sha}","languages_url":"https://api.github.com/repos/gbeili/flatbuffers/languages","stargazers_url":"https://api.github.com/repos/gbeili/flatbuffers/stargazers","contributors_url":"https://api.github.com/repos/gbeili/flatbuffers/contributors","subscribers_url":"https://api.github.com/repos/gbeili/flatbuffers/subscribers","subscription_url":"https://api.github.com/repos/gbeili/flatbuffers/subscription","commits_url":"https://api.github.com/repos/gbeili/flatbuffers/commits{/sha}","git_commits_url":"https://api.github.com/repos/gbeili/flatbuffers/git/commits{/sha}","comments_url":"https://api.github.com/repos/gbeili/flatbuffers/comments{/number}","issue_comment_url":"https://api.github.com/repos/gbeili/flatbuffers/issues/comments{/number}","contents_url":"https://api.github.com/repos/gbeili/flatbuffers/contents/{+path}","compare_url":"https://api.github.com/repos/gbeili/flatbuffers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gbeili/flatbuffers/merges","archive_url":"https://api.github.com/repos/gbeili/flatbuffers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gbeili/flatbuffers/downloads","issues_url":"https://api.github.com/repos/gbeili/flatbuffers/issues{/number}","pulls_url":"https://api.github.com/repos/gbeili/flatbuffers/pulls{/number}","milestones_url":"https://api.github.com/repos/gbeili/flatbuffers/milestones{/number}","notifications_url":"https://api.github.com/repos/gbeili/flatbuffers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gbeili/flatbuffers/labels{/name}","releases_url":"https://api.github.com/repos/gbeili/flatbuffers/releases{/id}","deployments_url":"https://api.github.com/repos/gbeili/flatbuffers/deployments","created_at":"2017-01-05T00:21:34Z","updated_at":"2017-01-05T01:32:05Z","pushed_at":"2017-01-24T20:13:05Z","git_url":"git://github.com/gbeili/flatbuffers.git","ssh_url":"git@github.com:gbeili/flatbuffers.git","clone_url":"https://github.com/gbeili/flatbuffers.git","svn_url":"https://github.com/gbeili/flatbuffers","homepage":"http://google.github.io/flatbuffers/","size":4125,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"bbef92c17d18c89235ef4c067fe2a4ed14e9df41","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":19953044,"name":"flatbuffers","full_name":"google/flatbuffers","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/flatbuffers","description":"Memory Efficient Serialization Library","fork":false,"url":"https://api.github.com/repos/google/flatbuffers","forks_url":"https://api.github.com/repos/google/flatbuffers/forks","keys_url":"https://api.github.com/repos/google/flatbuffers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/flatbuffers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/flatbuffers/teams","hooks_url":"https://api.github.com/repos/google/flatbuffers/hooks","issue_events_url":"https://api.github.com/repos/google/flatbuffers/issues/events{/number}","events_url":"https://api.github.com/repos/google/flatbuffers/events","assignees_url":"https://api.github.com/repos/google/flatbuffers/assignees{/user}","branches_url":"https://api.github.com/repos/google/flatbuffers/branches{/branch}","tags_url":"https://api.github.com/repos/google/flatbuffers/tags","blobs_url":"https://api.github.com/repos/google/flatbuffers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/flatbuffers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/flatbuffers/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/flatbuffers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/flatbuffers/statuses/{sha}","languages_url":"https://api.github.com/repos/google/flatbuffers/languages","stargazers_url":"https://api.github.com/repos/google/flatbuffers/stargazers","contributors_url":"https://api.github.com/repos/google/flatbuffers/contributors","subscribers_url":"https://api.github.com/repos/google/flatbuffers/subscribers","subscription_url":"https://api.github.com/repos/google/flatbuffers/subscription","commits_url":"https://api.github.com/repos/google/flatbuffers/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/flatbuffers/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/flatbuffers/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/flatbuffers/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/flatbuffers/contents/{+path}","compare_url":"https://api.github.com/repos/google/flatbuffers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/flatbuffers/merges","archive_url":"https://api.github.com/repos/google/flatbuffers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/flatbuffers/downloads","issues_url":"https://api.github.com/repos/google/flatbuffers/issues{/number}","pulls_url":"https://api.github.com/repos/google/flatbuffers/pulls{/number}","milestones_url":"https://api.github.com/repos/google/flatbuffers/milestones{/number}","notifications_url":"https://api.github.com/repos/google/flatbuffers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/flatbuffers/labels{/name}","releases_url":"https://api.github.com/repos/google/flatbuffers/releases{/id}","deployments_url":"https://api.github.com/repos/google/flatbuffers/deployments","created_at":"2014-05-19T18:33:01Z","updated_at":"2017-01-24T15:17:39Z","pushed_at":"2017-01-24T20:18:16Z","git_url":"git://github.com/google/flatbuffers.git","ssh_url":"git@github.com:google/flatbuffers.git","clone_url":"https://github.com/google/flatbuffers.git","svn_url":"https://github.com/google/flatbuffers","homepage":"http://google.github.io/flatbuffers/","size":3905,"stargazers_count":7265,"watchers_count":7265,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1080,"mirror_url":null,"open_issues_count":130,"forks":1080,"open_issues":130,"watchers":7265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/flatbuffers/pulls/4148"},"html":{"href":"https://github.com/google/flatbuffers/pull/4148"},"issue":{"href":"https://api.github.com/repos/google/flatbuffers/issues/4148"},"comments":{"href":"https://api.github.com/repos/google/flatbuffers/issues/4148/comments"},"review_comments":{"href":"https://api.github.com/repos/google/flatbuffers/pulls/4148/comments"},"review_comment":{"href":"https://api.github.com/repos/google/flatbuffers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/flatbuffers/pulls/4148/commits"},"statuses":{"href":"https://api.github.com/repos/google/flatbuffers/statuses/68bbe983e9819bcbcd214cf84d73a440863ed6ca"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":567,"deletions":121,"changed_files":12}}
{"actor":{"display_login":"gbeili"}}