-
Notifications
You must be signed in to change notification settings - Fork 148
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
Improved zsh completion time from ~0.5s to near instant #483
Conversation
completion/_catkin
Outdated
@@ -102,7 +102,8 @@ _catkin_packages_caching_policy() { | |||
if [[ -z "$_workspace_source_space" ]]; then | |||
_debug_log "Searching for source space..." | |||
|
|||
_workspace_source_space="$(catkin locate -s --quiet)" | |||
_catkin_get_enclosing_workspace $_workspace_root_hint | |||
_workspace_source_space="$_workspace_root/src" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a flawed assumption, the source directory is not always <workspace dir>/src
. Since it can be any folder, that's why catkin locate
is required to look up the setting.
Making Any idea if there is a way to replace TODO: Well ...
takes around 250ms.
takes around 175ms. Calling
takes around 30ms.
takes around 20ms. Also caching the source space path is not an option: To check if the cache is invalid, we need to check the date of the config.yaml, and getting the path takes around 175ms again ... Reimplementing the get_active_profile logic in zsh (or some compiled language) would be trivial and fast enough, but duplicating the logic is of course not an option. And I'm certain that implementing the logic in C++ and using it in python (similar to tf) was decided against long before I came along, besides it being to big of a change for this pull request :) What about adding a special case for "$_workspace_root/src" since it's what works for 99% of all users? It is the recommended layout after all ... Not even this special case works: Finding "$_workspace_root/src" does not mean that it is the source space :( |
- ... if the workspace has the recommended layout
bb26e81
to
04aa94a
Compare
If the issue is only due to asking for the version number, perhaps we could delay acquiring that information until it is asked for. However, I think in general the entry points performance is a bigger issue, see: #297 |
I close this pull request because the proposed solution isn't actually working:
Also my suggestion that replacing |
The "catkin locate -s" takes around 0.5s. It gets called whenever the cache is checked.