kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.39k stars 128 forks source link

Fetching windows takes multiple seconds #342

Open mickh opened 1 year ago

mickh commented 1 year ago

On my machine I am finding that either of the calls below takes multiple seconds to execute.

   const windows = Space.active().windows({visible: true});
   const windows = Window.all({visible: true});

Not completely certain, but this might have started happening when I updated to Sonoma. It can take up to 10 seconds for the calls to return.

A clue: the problem goes away (temporarily) if I open and immediately close a new Safari window.

Any ideas? Anyone else seeing this? Any suggestions for how I could debug further? I'm guessing that installing the phoenix source and pursuing the problem that way is the go. Or is there another way?

BTW: Thanks for phoenix. It's awesome!

mickh commented 1 year ago

Update: I completely quit Safari and the problem disappeared. I recently switched from using Google Chrome to Safari and, now I think about it, perhaps the problems started surfacing with that switch. Not completely certain on the timing, but I am going to switch back to Chrome for a week or two to see if the problem no longer manifests.

kasper commented 12 months ago

@mickh Sorry for the delay! Yes, this would indicate that one or more apps are not responding to API calls on a timely fashion, which then slows everything down. I have plans in the future to make this more dynamic and identify slowing apps faster for timeouts.

aidan-gibson commented 12 months ago

@mickh You aren't crazy, ever since Sonoma Phoenix has been crazy laggy for me (3+ seconds sometimes to resize a window on my normal laptop screen). To be fair my config is a disaster, but pre-Sonoma everything worked flawlessly. (also a big thank you to kasper for making this!!)

hboon commented 10 months ago

It's definitely Safari for me. If I kill Safari, .windows() is fast, otherwise it takes 6-17 seconds.

(.windows({ visible: true }) takes a similar amount of time)