{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/182446584","pull_request_review_id":113242714,"id":182446584,"diff_hunk":"@@ -116,7 +116,7 @@ unique_ptr<TransitInfo> SingleVehicleWorldGraph::GetTransitInfo(Segment const &)\n \n RoadGeometry const & SingleVehicleWorldGraph::GetRoadGeometry(NumMwmId mwmId, uint32_t featureId)\n {\n-  return m_loader->GetIndexGraph(mwmId).GetGeometry().GetRoad(featureId);\n+  return m_loader->GetGeometry(mwmId).GetRoad(featureId);","path":"routing/single_vehicle_world_graph.cpp","position":5,"original_position":5,"commit_id":"1c1c5b8f643ebfcec2a9470df9c368b5f9e0543e","original_commit_id":"1c1c5b8f643ebfcec2a9470df9c368b5f9e0543e","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars0.githubusercontent.com/u/1768114?v=4","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Да, конечно. Давай сделаем:\r\n```c++\r\nRoadGeometry const & TransitWorldGraph::GetRealRoadGeometry(NumMwmId mwmId, uint32_t featureId)\r\n{\r\n  CHECK(!TransitGraph::IsTransitFeature(featureId), (\"GetRealRoadGeometry not designed for transit.\"));\r\n  return m_indexLoader->GetGeometry(mwmId).GetRoad(featureId);\r\n}\r\n```","created_at":"2018-04-18T14:26:42Z","updated_at":"2018-04-18T14:26:42Z","html_url":"https://github.com/mapsme/omim/pull/8543#discussion_r182446584","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/8543","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/182446584"},"html":{"href":"https://github.com/mapsme/omim/pull/8543#discussion_r182446584"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/8543"}},"in_reply_to_id":182441228},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/8543","id":182461135,"html_url":"https://github.com/mapsme/omim/pull/8543","diff_url":"https://github.com/mapsme/omim/pull/8543.diff","patch_url":"https://github.com/mapsme/omim/pull/8543.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/8543","number":8543,"state":"open","locked":false,"title":"Performance and memory optimization for cross mwm routing.","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars0.githubusercontent.com/u/1768114?v=4","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"При прокладке протяженных авто маршрутов происходит в 2 этапа:\r\n 1. прокладка cross mwm -го маршрута (чтоб определить входы и выходы mwm через которые будет проходить маршрута);\r\n 1. затем, прокладка маршрута внутри каждой из mwm.\r\n\r\nРанее на первом этапе мы строили IndexGraph для каждой mwm, к которой прикосались. Хотя этого не требовалось. Достаточно просто иметь информацию о геометрии фич в этих mwm.\r\n\r\nДанный PR существенно оптимизирует первый этап прокладки маршрута в случае длинных авто маршрутов. Оптимизация достигается за счет того, что если требуется только геометрия mwm, не строится IndexGraph, Например, маршрут из Москвы в центр России памяти уходит в два с половиной - три раза меньше, а время на прокладки в треть быстрее.\r\n\r\nРезультаты измерений:\r\nАвто маршрут: Москва (55.7395, 37.5869) - Точка севернее Красноярска (60.7781, 96.5419), \r\nИзмерения проводились сериями по 3 попытки. Две серии на master. Две серии на данном PR. Карты всей России были загружены. Девайс на iPhone 7.\r\nДо оптимизации\r\n674MB максимальный расход памяти\r\nRoute found, elapsed seconds: 31.2168\r\nRoute found, elapsed seconds: 32.9107\r\nRoute found, elapsed seconds: 33.6691\r\n\r\n701MB максимальный расход памяти\r\nRoute found, elapsed seconds: 31.7622\r\nRoute found, elapsed seconds: 34.4661\r\nRoute found, elapsed seconds: 36.0487\r\n\r\nПотребление памяти:\r\n![image](https://user-images.githubusercontent.com/1768114/38931432-ced12e70-431b-11e8-9fd3-dae3216d11c8.png)\r\n\r\nПосле оптимизации\r\n220MB максимальный расход памяти\r\nRoute found, elapsed seconds: 23.9659\r\nRoute found, elapsed seconds: 23.3483\r\nRoute found, elapsed seconds: 22.0784\r\n\r\n230MB максимальный расход памяти\r\nRoute found, elapsed seconds: 21.087\r\nRoute found, elapsed seconds: 23.4805\r\nRoute found, elapsed seconds: 23.2327\r\n\r\nПотребление памяти:\r\n![image](https://user-images.githubusercontent.com/1768114/38931448-da52c63c-431b-11e8-97d8-36c76781261b.png)\r\n\r\n@tatiana-yan @mpimenov PTAL\r\n","created_at":"2018-04-18T12:23:01Z","updated_at":"2018-04-18T14:26:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"217eaa72d7d0ad305676eff82f9e3a7b0a288fcb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mpimenov","id":10366009,"avatar_url":"https://avatars0.githubusercontent.com/u/10366009?v=4","gravatar_id":"","url":"https://api.github.com/users/mpimenov","html_url":"https://github.com/mpimenov","followers_url":"https://api.github.com/users/mpimenov/followers","following_url":"https://api.github.com/users/mpimenov/following{/other_user}","gists_url":"https://api.github.com/users/mpimenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpimenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpimenov/subscriptions","organizations_url":"https://api.github.com/users/mpimenov/orgs","repos_url":"https://api.github.com/users/mpimenov/repos","events_url":"https://api.github.com/users/mpimenov/events{/privacy}","received_events_url":"https://api.github.com/users/mpimenov/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/8543/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/8543/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/8543/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/1c1c5b8f643ebfcec2a9470df9c368b5f9e0543e","head":{"label":"bykoianko:master-routing-minimize-mem-consumption2","ref":"master-routing-minimize-mem-consumption2","sha":"1c1c5b8f643ebfcec2a9470df9c368b5f9e0543e","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars0.githubusercontent.com/u/1768114?v=4","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"repo":{"id":43428862,"name":"omim","full_name":"bykoianko/omim","owner":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars0.githubusercontent.com/u/1768114?v=4","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bykoianko/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/bykoianko/omim","forks_url":"https://api.github.com/repos/bykoianko/omim/forks","keys_url":"https://api.github.com/repos/bykoianko/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bykoianko/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bykoianko/omim/teams","hooks_url":"https://api.github.com/repos/bykoianko/omim/hooks","issue_events_url":"https://api.github.com/repos/bykoianko/omim/issues/events{/number}","events_url":"https://api.github.com/repos/bykoianko/omim/events","assignees_url":"https://api.github.com/repos/bykoianko/omim/assignees{/user}","branches_url":"https://api.github.com/repos/bykoianko/omim/branches{/branch}","tags_url":"https://api.github.com/repos/bykoianko/omim/tags","blobs_url":"https://api.github.com/repos/bykoianko/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bykoianko/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bykoianko/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/bykoianko/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bykoianko/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/bykoianko/omim/languages","stargazers_url":"https://api.github.com/repos/bykoianko/omim/stargazers","contributors_url":"https://api.github.com/repos/bykoianko/omim/contributors","subscribers_url":"https://api.github.com/repos/bykoianko/omim/subscribers","subscription_url":"https://api.github.com/repos/bykoianko/omim/subscription","commits_url":"https://api.github.com/repos/bykoianko/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/bykoianko/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/bykoianko/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/bykoianko/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/bykoianko/omim/contents/{+path}","compare_url":"https://api.github.com/repos/bykoianko/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bykoianko/omim/merges","archive_url":"https://api.github.com/repos/bykoianko/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bykoianko/omim/downloads","issues_url":"https://api.github.com/repos/bykoianko/omim/issues{/number}","pulls_url":"https://api.github.com/repos/bykoianko/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/bykoianko/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/bykoianko/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bykoianko/omim/labels{/name}","releases_url":"https://api.github.com/repos/bykoianko/omim/releases{/id}","deployments_url":"https://api.github.com/repos/bykoianko/omim/deployments","created_at":"2015-09-30T11:21:20Z","updated_at":"2018-03-15T15:16:23Z","pushed_at":"2018-04-18T12:05:09Z","git_url":"git://github.com/bykoianko/omim.git","ssh_url":"git@github.com:bykoianko/omim.git","clone_url":"https://github.com/bykoianko/omim.git","svn_url":"https://github.com/bykoianko/omim","homepage":null,"size":3613316,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"50d45e1f91c65c9f3e81c0e095181b16b1abfc13","user":{"login":"mapsme","id":14185141,"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,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"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},"private":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-04-18T11:39:13Z","pushed_at":"2018-04-18T14:17:51Z","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":3756928,"stargazers_count":2642,"watchers_count":2642,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":573,"mirror_url":null,"archived":false,"open_issues_count":669,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":573,"open_issues":669,"watchers":2642,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/8543"},"html":{"href":"https://github.com/mapsme/omim/pull/8543"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/8543"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/8543/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/8543/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/8543/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/1c1c5b8f643ebfcec2a9470df9c368b5f9e0543e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bykoianko"}}