Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

[roslaunch] cache result of path finding for faster roslaunch behavior#676

Merged
dirk-thomas merged 1 commit intoros:indigo-develfrom
wkentaro:cache-result-of-find-packages
Oct 9, 2015
Merged

[roslaunch] cache result of path finding for faster roslaunch behavior#676
dirk-thomas merged 1 commit intoros:indigo-develfrom
wkentaro:cache-result-of-find-packages

Conversation

@wkentaro
Copy link
Copy Markdown
Contributor

This is for faster roslaunch's node launching.

Closes #541
Closes #542

This is firstly reported by @garaemon .

@ros-pull-request-builder
Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

@wkentaro wkentaro changed the title [roslaunch] cache result of path finding [roslaunch] cache result of path finding for faster roslaunch behavior Sep 29, 2015
@wkentaro wkentaro changed the title [roslaunch] cache result of path finding for faster roslaunch behavior [indigo] [roslaunch] cache result of path finding for faster roslaunch behavior Sep 29, 2015
@wkentaro wkentaro changed the title [indigo] [roslaunch] cache result of path finding for faster roslaunch behavior [roslaunch] cache result of path finding for faster roslaunch behavior Sep 29, 2015
@wkentaro
Copy link
Copy Markdown
Contributor Author

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch 3 times, most recently from 2424fcc to 09d9fa1 Compare September 29, 2015 19:19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg and resource_name are not keyword arguments. Therefore please pass them as positional arguments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they are keyword arguments.
https://github.com/ros/ros/blob/jade-devel/core/roslib/src/roslib/packages.py#L463

and cached.py in this package supports both.
https://github.com/ros/ros_comm/pull/676/files#diff-66abf4062401099443c44fc29a06e40aR28

cached.find_resource(args[0], args[1])
cached.find_resource(pkg=args[0], resource_name=args[1])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change I made about the arguments are just a refactoring.
Using keyword arguments is good habit I think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are passing the two standard arguments as if they were keyword arguments. Please pass them without the keyword instead.

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch from 09d9fa1 to 10e7bc2 Compare October 8, 2015 09:53
@wkentaro
Copy link
Copy Markdown
Contributor Author

wkentaro commented Oct 8, 2015

I updated the commit, so please review again.

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch 3 times, most recently from 555882e to 892245a Compare October 8, 2015 11:13
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid unrelated white space changes.

@dirk-thomas
Copy link
Copy Markdown
Member

Beside the comment the PRs look good. the performance improvement is definitely notable when the launch file has several resources to look up.

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch 3 times, most recently from aaa7975 to 4fc55e9 Compare October 8, 2015 20:16
@wkentaro
Copy link
Copy Markdown
Contributor Author

wkentaro commented Oct 8, 2015

I updated the commit following your comments.
Please review again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the import one line up to follow PEP8.

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch from 4fc55e9 to 293bf4c Compare October 8, 2015 20:22
@wkentaro
Copy link
Copy Markdown
Contributor Author

wkentaro commented Oct 8, 2015

I updated again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late tiny feedback but some of it only appears when I open the code in my editor which does all kind of style checks.

Please change first word from Returns to Return (PEP257 D401).
Please add an empty line between this and the next line (PEP257 D205).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will.

@wkentaro wkentaro force-pushed the cache-result-of-find-packages branch from 293bf4c to 72a9a91 Compare October 9, 2015 06:07
@wkentaro
Copy link
Copy Markdown
Contributor Author

wkentaro commented Oct 9, 2015

I updated the commit. Please review again.

@dirk-thomas
Copy link
Copy Markdown
Member

Thanks for iterating on the patch.

dirk-thomas added a commit that referenced this pull request Oct 9, 2015
[roslaunch] cache result of path finding for faster roslaunch behavior
@dirk-thomas dirk-thomas merged commit ea9a768 into ros:indigo-devel Oct 9, 2015
@wkentaro wkentaro deleted the cache-result-of-find-packages branch October 9, 2015 16:39
@wkentaro
Copy link
Copy Markdown
Contributor Author

wkentaro commented Oct 9, 2015

Thanks! 😄

@garaemon
Copy link
Copy Markdown

awesome feature!! :)

@dirk-thomas
Copy link
Copy Markdown
Member

I reviewed the change again and think an alternative approach will be even better. Currently the already passed in rospack instance is supposed to do some caching. But for separate nodes new instances are created. The following patches revert the previous changes and ensure that a single rospack instance is used which also caches the additional package mapping information:

@wkentaro Can you please confirm that these changes also work in your scenario and that they improve performance even more?

@dirk-thomas
Copy link
Copy Markdown
Member

I have reverted the changes from this PR in favor of #682.

rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017
[roslaunch] cache result of path finding for faster roslaunch behavior
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants