-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpha 5 release (2016-04-01) #198
Comments
While the choice to use Python for most of the command line tools I think we should reconsider this decision. Based on experience with ROS 1 I think certain commands needs to be C++ since the startup time of a Python script might already incur a too high latency when the result is e.g. being used for auto completion. E.g. rospack providing package names and files within packages is written in C++ for exactly that reason. |
I agree, but I think it would be useful to start in Python (capability should be there anyways) and actually take time to profile CLI tools afterwards. For slow tools there are lots of things you can do to speed up Python (avoiding unnecessary imports for example), and if that is not enough you can rewrite in C++. We should be wary of premature optimization. |
I was less referring to the actual performance of the implementation but the inherent startup time of Python which has been shown to be a significant problem for auto completion (even if the tool itself would run in no time). Therefore I don't think this classifies as premature optimization but considering for which cases we already foresee that a Python based implementation will not meet the requirements of the intended use cases. |
Depending on the use of the tool for tab completion the startup time of Python shouldn't be a real issue (on the order of 40 ms and on my machine rospack's is around 20ms). So, I think it's possible to use Python in tab completion if you're careful. For example, listing directories from an environment variable (a likely task for tab completion) is only 37ms:
If I use
23ms is almost as fast as BTW, Python2 is a good deal faster, maybe Python3's performance will improve:
So, it's not clear cut to me that starting in C++ for any tools make sense, especially when weighed against the difficulty of implementing a nice to use command line tool without |
stretch / bumped goals
The text was updated successfully, but these errors were encountered: