~scoopta/wofi#149: 
Slow application search

When running as wofi -S run and searching for a hitherto unlaunched program, it sometimes takes several seconds until it shows up in the result list. I'm really confused by what's going on here.

It can't be GUI slowness or IO issues: When I run dmenu_path | wofi -S dmenu, all options are available pretty much instantly without any noticeable startup delay.

It's such a substantial difference that I'm honestly not sure if I am holding something wrong. Am I not setting some vital option? I would really like to use -S run since it puts recently used commands at the top of the list, but results sometimes show up so late that I run the wrong things.

Status
REPORTED
Submitter
~majewsky
Assigned to
No-one
Submitted
4 years ago
Updated
4 years ago
Labels
No labels applied.

~scoopta 4 years ago

It pretty much comes down to the number of entries wofi has to process. The GTK widget wofi uses is rather inefficient for large lists. There are a number of issues open in regards to performance at this point. I'm trying to figure out what the best way to approach this because unfortunately there is a massive amount of work involved in pulling out the current implementation. See #35

~majewsky 4 years ago

This is definitely not about the GTK widget. As I said, when I run dmenu_path | wofi -S dmenu, I get a wofi with 4346 options and that is displayed instantly.

~cloudninja 4 years ago

So I decided to test, I wrote a small lua script to dump my entire PATH into lines, and wofi definitely doesn't handle a full 5551 lines in dmenu mode instantly, so I'm not sure how you're accomplishing this. My script itself runs in less than .1 seconds according to the time util, so it shouldn't be a limiting factor there. Are you sure wofi is actually displaying all 4346 options, or just the ones you're actually using? If you don't have it hidden with css somehow, check that if you scroll wofi all the way to the bottom with the scrollbar that it doesn't move at all when you let go. I suspect Wofi is still populating the entire time.

~majewsky 4 years ago

Hm indeed, seq 1 10000 | wofi -S dmenu makes it clear that the list gets populated over time. Presumably all the options that I tried initially were from the top of the list and thus were populated into the list by the time I finished typing them in.

Register here or Log in to comment, or comment via email.