{"action":"created","issue":{"url":"https://api.github.com/repos/ros/ros_comm/issues/541","labels_url":"https://api.github.com/repos/ros/ros_comm/issues/541/labels{/name}","comments_url":"https://api.github.com/repos/ros/ros_comm/issues/541/comments","events_url":"https://api.github.com/repos/ros/ros_comm/issues/541/events","html_url":"https://github.com/ros/ros_comm/issues/541","id":53175676,"number":541,"title":"[roslaunch] cache result of catkin_pkg.packages.find_packages to speed up roslaunch","user":{"login":"garaemon","id":40454,"avatar_url":"https://avatars.githubusercontent.com/u/40454?v=3","gravatar_id":"","url":"https://api.github.com/users/garaemon","html_url":"https://github.com/garaemon","followers_url":"https://api.github.com/users/garaemon/followers","following_url":"https://api.github.com/users/garaemon/following{/other_user}","gists_url":"https://api.github.com/users/garaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/garaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaemon/subscriptions","organizations_url":"https://api.github.com/users/garaemon/orgs","repos_url":"https://api.github.com/users/garaemon/repos","events_url":"https://api.github.com/users/garaemon/events{/privacy}","received_events_url":"https://api.github.com/users/garaemon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-31T09:37:56Z","updated_at":"2015-10-03T07:27:07Z","closed_at":null,"body":"![roslaunch_caller](https://cloud.githubusercontent.com/assets/40454/5586761/ff9a311a-911b-11e4-9a4e-05be2ee22011.png)\r\n\r\noriginally discussed in [here](https://github.com/ros-infrastructure/catkin_pkg/pull/111)\r\n\r\n## Problem\r\n* roslaunch is slow if catkin workspace has a lot of files\r\n* `catkin_pkg.packages.find_packages` always scan workspace and it's not fast enough\r\n* When rosbuild was used, roslaunch was not so slow, as far as I remember\r\n\r\n## Approach\r\n* During running roslaunch, catkin workspace must not be changed, so we can cache `catkin_pkg.packages.find_packages` like old rospack\r\n* In order to keep backward compatibility, add keyword arguments to functions\r\n\r\n## Benchmark\r\n* Use [test.rosinstall](https://gist.github.com/garaemon/7a39457795e7c61d7d8c) to build workspace\r\n\r\n  ```\r\n$ find src | wc -l\r\n17239\r\n$ find src -name package.xml | wc -l\r\n286\r\n$ find src -name manifest.xml | wc -l\r\n146\r\n  ```\r\n* Measure time of `roslaunch openni2_launch openni2.launch`\r\n* Result\r\n  * without caching -- 17 sec\r\n  * with caching -- 5 sec\r\n  * Movie\r\n    * [without caching](http://youtu.be/_Utax0R3u0g)\r\n    * [with caching](http://youtu.be/bAFNlsNcihU)\r\n"},"comment":{"url":"https://api.github.com/repos/ros/ros_comm/issues/comments/145211666","html_url":"https://github.com/ros/ros_comm/issues/541#issuecomment-145211666","issue_url":"https://api.github.com/repos/ros/ros_comm/issues/541","id":145211666,"user":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T07:27:06Z","updated_at":"2015-10-03T07:27:06Z","body":"cc: @guihomework "}}