{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/230382853","pull_request_review_id":171112499,"id":230382853,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDM4Mjg1Mw==","diff_hunk":"@@ -0,0 +1,44 @@\n+#pragma once\n+\n+#include \"coding/reader.hpp\"\n+#include \"coding/varint.hpp\"\n+#include \"coding/write_to_sink.hpp\"\n+\n+#include <cstdint>\n+\n+using LocalizableString = std::unordered_map<uint8_t, std::string>;\n+using LocalizableStringSubIndex = std::map<uint8_t, uint32_t>;\n+using LocalizableStringIndex = std::vector<LocalizableStringSubIndex>;\n+\n+template<typename Sink>\n+inline void WriteLocalizableStringIndex(Sink & sink, LocalizableStringIndex const & index)","path":"coding/localizable_string.hpp","position":14,"original_position":14,"commit_id":"19873ebe61ee17b3586b29a127420cad539982dd","original_commit_id":"19873ebe61ee17b3586b29a127420cad539982dd","user":{"login":"ygorshenin","id":454567,"node_id":"MDQ6VXNlcjQ1NDU2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/454567?v=4","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"@maksimandrianov а где то утверждается что это одно и то же?","created_at":"2018-11-02T14:01:06Z","updated_at":"2018-11-02T14:01:07Z","html_url":"https://github.com/mapsme/omim/pull/9783#discussion_r230382853","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/9783","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/230382853"},"html":{"href":"https://github.com/mapsme/omim/pull/9783#discussion_r230382853"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9783"}},"in_reply_to_id":230329829},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/9783","id":227887725,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3ODg3NzI1","html_url":"https://github.com/mapsme/omim/pull/9783","diff_url":"https://github.com/mapsme/omim/pull/9783.diff","patch_url":"https://github.com/mapsme/omim/pull/9783.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/9783","number":9783,"state":"open","locked":false,"title":"Description section serializer and deserializer added.","user":{"login":"darina","id":1092934,"node_id":"MDQ6VXNlcjEwOTI5MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1092934?v=4","gravatar_id":"","url":"https://api.github.com/users/darina","html_url":"https://github.com/darina","followers_url":"https://api.github.com/users/darina/followers","following_url":"https://api.github.com/users/darina/following{/other_user}","gists_url":"https://api.github.com/users/darina/gists{/gist_id}","starred_url":"https://api.github.com/users/darina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darina/subscriptions","organizations_url":"https://api.github.com/users/darina/orgs","repos_url":"https://api.github.com/users/darina/repos","events_url":"https://api.github.com/users/darina/events{/privacy}","received_events_url":"https://api.github.com/users/darina/received_events","type":"User","site_admin":false},"body":"Реквест добавляет серилизатор и десереализатор секции, которая будет хранить в себе описания фич. Предполагается, что описание фичи будет показываться в PP, т.е. основной сценарий - точечная вычитка описания для одной фичи и конкретного языка. В описании может храниться строки для разных языков, которые могут быть как короткими, так и достаточно длинными (полная статья из википедии).\r\n\r\nДля хранения строк рассматривался вариант хранения переводов описания в строке MultilangUtf8String, которая используется, например, для хранения имен фич.\r\nПоскольку длина описания может быть большой, и нет необходимости вычитывать все доступные переводы, то хранение переводов в MultilangUtf8String не выглядит оптимальным.\r\n\r\nВ предложенном варианте метаинформация о доступных языках описания и сами строки хранятся раздельно. Строки из разных описаний перед сериализацией группируются по языкам для лучшего сжатия.\r\n\r\nБыл проведен тест, сравнивающий хранение описаний в MultilangUtf8String с методом, реализованном в данном PR. Для теста использовались 12 описаний, каждое из которых содержало строки для 5 языков (из разных языковых групп). Строки были взяты из википедии.  При средней длине строки перевода в 400 символов и размере блока BlockedTextStorageWriter в 200000, разницы по объему занимаемой памяти нет. Если понижать размер блока до нескольких средних размеров строк, то размер секции с MultilangUtf8String получается больше. Однако это не дает четких выводов, т.к. нужен тест на реальных данных с длинными строками переводов. Подготовкой данных будет заниматься @maksimandrianov. Предполагалось, что после получения реальных данных будет произведен еще один сравнительный тест.\r\n\r\nПри текущем хранении, чтобы получить описание для конкретного языка, сначала будет вычитан блок с метаинформацией, хранящий доступные коды языков и соответствующие им индексы строк. Если код языка найден, то вычитывается строка по индексу.","created_at":"2018-11-02T10:08:43Z","updated_at":"2018-11-02T14:01:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7ae2edc26ad0a6e221c6ea2a665e4c79ced2644","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rokuz","id":5437220,"node_id":"MDQ6VXNlcjU0MzcyMjA=","avatar_url":"https://avatars1.githubusercontent.com/u/5437220?v=4","gravatar_id":"","url":"https://api.github.com/users/rokuz","html_url":"https://github.com/rokuz","followers_url":"https://api.github.com/users/rokuz/followers","following_url":"https://api.github.com/users/rokuz/following{/other_user}","gists_url":"https://api.github.com/users/rokuz/gists{/gist_id}","starred_url":"https://api.github.com/users/rokuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rokuz/subscriptions","organizations_url":"https://api.github.com/users/rokuz/orgs","repos_url":"https://api.github.com/users/rokuz/repos","events_url":"https://api.github.com/users/rokuz/events{/privacy}","received_events_url":"https://api.github.com/users/rokuz/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/9783/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/9783/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/9783/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/19873ebe61ee17b3586b29a127420cad539982dd","head":{"label":"darina:descriptions","ref":"descriptions","sha":"19873ebe61ee17b3586b29a127420cad539982dd","user":{"login":"darina","id":1092934,"node_id":"MDQ6VXNlcjEwOTI5MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1092934?v=4","gravatar_id":"","url":"https://api.github.com/users/darina","html_url":"https://github.com/darina","followers_url":"https://api.github.com/users/darina/followers","following_url":"https://api.github.com/users/darina/following{/other_user}","gists_url":"https://api.github.com/users/darina/gists{/gist_id}","starred_url":"https://api.github.com/users/darina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darina/subscriptions","organizations_url":"https://api.github.com/users/darina/orgs","repos_url":"https://api.github.com/users/darina/repos","events_url":"https://api.github.com/users/darina/events{/privacy}","received_events_url":"https://api.github.com/users/darina/received_events","type":"User","site_admin":false},"repo":{"id":43497440,"node_id":"MDEwOlJlcG9zaXRvcnk0MzQ5NzQ0MA==","name":"omim","full_name":"darina/omim","private":false,"owner":{"login":"darina","id":1092934,"node_id":"MDQ6VXNlcjEwOTI5MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1092934?v=4","gravatar_id":"","url":"https://api.github.com/users/darina","html_url":"https://github.com/darina","followers_url":"https://api.github.com/users/darina/followers","following_url":"https://api.github.com/users/darina/following{/other_user}","gists_url":"https://api.github.com/users/darina/gists{/gist_id}","starred_url":"https://api.github.com/users/darina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darina/subscriptions","organizations_url":"https://api.github.com/users/darina/orgs","repos_url":"https://api.github.com/users/darina/repos","events_url":"https://api.github.com/users/darina/events{/privacy}","received_events_url":"https://api.github.com/users/darina/received_events","type":"User","site_admin":false},"html_url":"https://github.com/darina/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/darina/omim","forks_url":"https://api.github.com/repos/darina/omim/forks","keys_url":"https://api.github.com/repos/darina/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darina/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darina/omim/teams","hooks_url":"https://api.github.com/repos/darina/omim/hooks","issue_events_url":"https://api.github.com/repos/darina/omim/issues/events{/number}","events_url":"https://api.github.com/repos/darina/omim/events","assignees_url":"https://api.github.com/repos/darina/omim/assignees{/user}","branches_url":"https://api.github.com/repos/darina/omim/branches{/branch}","tags_url":"https://api.github.com/repos/darina/omim/tags","blobs_url":"https://api.github.com/repos/darina/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darina/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darina/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/darina/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darina/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/darina/omim/languages","stargazers_url":"https://api.github.com/repos/darina/omim/stargazers","contributors_url":"https://api.github.com/repos/darina/omim/contributors","subscribers_url":"https://api.github.com/repos/darina/omim/subscribers","subscription_url":"https://api.github.com/repos/darina/omim/subscription","commits_url":"https://api.github.com/repos/darina/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/darina/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/darina/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/darina/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/darina/omim/contents/{+path}","compare_url":"https://api.github.com/repos/darina/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darina/omim/merges","archive_url":"https://api.github.com/repos/darina/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darina/omim/downloads","issues_url":"https://api.github.com/repos/darina/omim/issues{/number}","pulls_url":"https://api.github.com/repos/darina/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/darina/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/darina/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darina/omim/labels{/name}","releases_url":"https://api.github.com/repos/darina/omim/releases{/id}","deployments_url":"https://api.github.com/repos/darina/omim/deployments","created_at":"2015-10-01T13:18:35Z","updated_at":"2018-11-02T10:08:15Z","pushed_at":"2018-11-02T10:08:12Z","git_url":"git://github.com/darina/omim.git","ssh_url":"git@github.com:darina/omim.git","clone_url":"https://github.com/darina/omim.git","svn_url":"https://github.com/darina/omim","homepage":null,"size":4027962,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"fe6313ec6fe3338315f3bcac3f26042dfbb55a35","user":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjc5ODAzMw==","name":"omim","full_name":"mapsme/omim","private":false,"owner":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mapsme/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2018-11-01T11:47:06Z","pushed_at":"2018-11-02T13:30:48Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":"","size":4156635,"stargazers_count":2831,"watchers_count":2831,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":612,"mirror_url":null,"archived":false,"open_issues_count":759,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":612,"open_issues":759,"watchers":2831,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9783"},"html":{"href":"https://github.com/mapsme/omim/pull/9783"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/9783"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/9783/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9783/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9783/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/19873ebe61ee17b3586b29a127420cad539982dd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ygorshenin"}}