Watson: Slow fish completions

Context (Environment)

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

Most upvoted comments

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, and watson 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, but watson edit does not appear to have the same issues that watson start does.

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).