Skip to content
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

Slow loading of apps page on fast PC (~500ms) #59

Open
robotabc773 opened this issue Dec 15, 2022 · 15 comments
Open

Slow loading of apps page on fast PC (~500ms) #59

robotabc773 opened this issue Dec 15, 2022 · 15 comments

Comments

@robotabc773
Copy link

When I activate ilia with meta+space and start typing immediately, it takes my input but seems to not load the entire list in time and I get stuck on a worse result. For example, steam generates desktop entries for all installed games, so they all show up in ilia. When I press meta+space and immediately type "steam", I consistently end up on a game near the bottom of the list ("UNBEATABLE [white label]"). If I wait a second to start typing, it correctly highlights steam as the top option.

@kgilmer
Copy link
Member

kgilmer commented Dec 15, 2022

Hi, what version is ilia? apt list --installed | grep ilia

@robotabc773
Copy link
Author

Doing that reminded me to upgrade ilia, so I'm now on 0.12.29-jammy-1regolith. This appears to have solved it, as ilia now appears to not accept any input until it has fully loaded the list. This does mean that if I start typing immediately that some of the input just gets missed or sent to the previous application, but this is a definite improvement. Probably should've checked for upgrades before I made an issue 😅

@kgilmer
Copy link
Member

kgilmer commented Dec 16, 2022

Well I'm glad to hear you were not seeing that on the latest version, as yes , I removed the async loading of apps due to similar bugs that were difficult to reproduce. How much time between key press to full list would you say? Generally can you classify your hardware? Do you consider the delay to be annoying?

@robotabc773
Copy link
Author

It's somewhere around half a second, which isn't so bad but I do have a quite powerful computer. It's got a higher end amd cpu and gpu and an ssd so I'd generally expect good performance. At the moment it throws me off a bit because I'm used to the old version but I'm sure I'll get used to it.

For what it's worth, I don't know how feasible this is, but I think that a good solution could be to lock the cursor to the top result until the list is finished loading, and only then switch over to locking it to whatever it's already on. That way if you type "steam+Enter" you'll definitely end up running the top result for "steam".

@kgilmer
Copy link
Member

kgilmer commented Dec 16, 2022

Thanks for that feedback, very helpful @robotabc773 . Odd that you notice such a slow load on a fast computer. Perhaps you have many many desktop apps..I can't think of what else would cause the slowdown.

Thanks for your suggestion, and it's a good one. But as I've switched to loading the apps synchronously it's now "all or nothing". I'll look into allowing filter selection text entry before loading finished, so that at least the workflow isn't broken until the apps load. It should be pretty easy to simulate slow loading to test out this work. I'll re-open this issue to track that work.

Oh one other tip is that you should get faster load times if you set the icon size to 0, with the down side being no icons. But, if the majority of time is spent in loading the desktop apps from glib, then perhaps it wouldn't be much better..

@kgilmer kgilmer reopened this Dec 16, 2022
@kgilmer kgilmer changed the title Strange selections when typing early Slow loading of apps page on fast PC (~500ms) Dec 16, 2022
@robotabc773
Copy link
Author

Thanks for the tip, I'll see if I can get you some more accurate data on timing and how many desktop apps I have if it'll help.

@kgilmer
Copy link
Member

kgilmer commented Dec 16, 2022

Desktop app count would be interesting but don't spend more than a few minutes on it

@kgilmer
Copy link
Member

kgilmer commented Dec 16, 2022

This might do it: $ find / -name \*.desktop -type f | grep applications | wc -l. I have 177.

@robotabc773
Copy link
Author

Using a stopwatch I got a slightly better estimate of around 300-350 ms to open ilia. I appear to have 266 desktop applications.

@kgilmer
Copy link
Member

kgilmer commented Dec 24, 2022

I've done some profiling and on my machine it takes about ~180ms to load the app launch dialog. Breaking down where the time is spent, about half of it is in icon loading. (In fact, it seems that some icons take 10x to load than others, but it's not clear to me what the root cause of that is.) I've created a branch that loads icons in a background thread to allow the dialog to load faster. The downside to this I haven't found a way of dealing with is that you can see the refresh occur as the dialog loads.

If you're able to build this branch, or would be alright with installing a deb, I'd be curious if this change results in better UX for you @robotabc773 .

@robotabc773
Copy link
Author

Unfortunately I'm away from my PC for the next few weeks, but I'll give it a try when I can.

@bobdanek
Copy link

Same issue here, building from the app-load-optimization branch and tossing that into ~/.local/bin results in a much less laggy initial launch. I still manage to get a character or two typed into the window that had focus before ilia launched, but previously it was more like 5 or 6 characters.

Still a small delay, but it's much better

(sorry for copy/paste comment, wanted to make sure I got this in the issue I found that branch from)

@kgilmer
Copy link
Member

kgilmer commented Jan 18, 2023

Thanks for the feedback @bobdanek , very helpful. I'm still searching for a way of reproducing slow loads. How many desktop apps do you have on your system? (find / -name \*.desktop -type f | grep applications | wc -l)

@bobdanek
Copy link

bobdanek commented Jan 18, 2023

270 from that command. Around 95 manually counted in the launcher.

About 54 manually counted in the launcher of my work laptop, and the issue doesn't seem nearly as bad on that device (I only built that branch and tossed it in my path for my personal laptop)

If it helps to have some more info, my personal laptop is running Pop!_OS with Regolith installed over it, while my work laptop is running the Regolith distro directly. Hardware is mostly the same (Ryzen 7 8-core mobile ThinkPad T14s - gen1 and gen2)

@dephekt
Copy link

dephekt commented Apr 20, 2023

Don't mean to +1 this, just wanted to add another data point. I've noticed this issue too since Regolith 2 or shortly after. I used to be able to Super+Space and immediately start typing, but now 2-4 characters get eaten before the window opens and takes focus. I have 263 apps based on the find command you pasted.

It's mostly annoying because muscle memory from using Regolith 1.6 never required a pause and even after using Regolith 2 since release, I still find it messing up my workflow when I'm moving fast.

Hardware is as follows:
Core i7 9750H, NVIDIA RTX 2070, Samsung 980 Pro SSD NVMe (System76 Adder WS) running Pop OS 22.04

System is the same one I was using Regolith 1.6 on without issues. If there's a way to configure it in Xresources to not display any icons to make Ilia open faster, I'm happy to do that, but I couldn't find a config key for it if it exists.

For anyone else trying to build ilia app-load-optimization locally on Debian-like systems, I needed:

sudo apt-get install valac-bin valac-0.56-vapi libjson-glib-dev libtracker-sparql-3.0-dev libgee-0.8-dev libgtk-layer-shell-dev libgirepository1.0-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants