Watson: Slow fish completions
Context (Environment)
- Terminal: rxvt-unicode-pixbuf 9.22-2
- Shell: fish-3.0.0-1
- Version: watson 1.6.0-1
- Completion: latest version from https://github.com/TailorDev/Watson/commit/f1a2c94c1878a6f0cace8bdd509628990e319c65
Expected Behavior
Completions as fast as zsh. Here I am using watson add (wa is my alias) in zsh:
The projects almost come up instantly, and the + for the tags right after comes almost immediately.
Current Behavior
Pretty unexpectedly slow completions in fish.
The projects take a few seconds to come up, and the + for the tags right takes bizarrely long to show up, even though it’s not actually displaying any tags yet. I should also note that my other completions for fish aren’t experiencing the same problem.
Proposal
Could the speed of this be improved in any way, or is it just a problem on my own machine?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 15 (11 by maintainers)
Commits related to this issue
- Cached projects/tags for fish to fix #250 Cache is invalidated when frames file is newer than cache file. — committed to Kevin-Mok/Watson by Kevin-Mok 5 years ago
- Added frames cache (#250) Also refactored cache invalidation to helper function. — committed to Kevin-Mok/Watson by Kevin-Mok 5 years ago
- Cached projects/tags/frames for fish to fix #250 Cache is invalidated when frames file is newer than cache file. — committed to Kevin-Mok/Watson by Kevin-Mok 5 years ago
- Cached projects/tags/frames for fish to fix #250 Cache is invalidated when frames file is newer than cache file. — committed to Kevin-Mok/Watson by Kevin-Mok 5 years ago
It might be worthwhile to explore adding a limit (or an option to limit) the depth watson scans for projects and tags. In the case of this completion, There is a high probability that we would only be interested in the last 7-30 days worth of frames (or the last 100 frames).
I was also thinking last night about the feasibility of using memcached for either the completion side or for watson if it is installed on the system.
– wanted to drop an update on this:
I did notice that zsh caches the output of
watson tags,watson projects, andwatson frames, where fish (from what I can tell) does not have such a feature. in watson.fish we collect tags, frames, and projects by running the respective watson command, butwatson editdoes not appear to have the same issues thatwatson startdoes.I’m still looking at ways of speeding this up. It is possible that the completion is being slowed down by iterating over the command looking for projects, and then iterating over it again looking for tags.
I’ll keep digging
Hi @Kevin-Mok ! Thanks for the report. We will need relevant inputs from Fish users (which I am not).