-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Delay/freeze when switching focus & workspace #131
Comments
(1) How many windows do you have opened? (you can use I saw on my colleague's machine that AeroSpace may behave poorly if there are unreasonably many windows opened (maybe 100 or even more, we didn't count) I tried to open 20 windows and it performs well, I don't see any delay compared to when AeroSpace is not running
I can't see any delay on my machine (M1 Pro + Sonoma). I normally don't have more than 10 windows opened
I heard several times that Accessibility API is slow. Though, I can't confirm it yet. The only slowness of Accessibility API I noticed is when some apps block their UI thread in some special way (I couldn't reproduce the slowness when I wrote a small app that displays a simple window and blocks the UI thread). For example, Spotify and Firefox sometimes block the UI thread in a special way for several seconds when I try to quit ( (3) Some of the apps that you are running may have similar problems, so you can try to quit apps one by one to see when AeroSpace delay goes away |
Hi! I'm experiencing this issue on my Macbook Pro 14 with M1 Pro on macOS Sonoma, but a little bit differently. but when I switch and then immediately switch again and again (and so on) it takes noticeably less time to switch. If there was some logging tool that would allow to measure the time to switch workspace, then I could attach such log file to this comment. It's actually hard to record on video without some keys recording (but I can try ofc) extra info |
Hi! I'm experiencing this issue too on M1 Pro MBP. And the situation only happened when I starting debug an application with idea. Seems this is what @nikitabobko said but a stable reproduce way. (at least for me)
Are there any way I can offer more infos? |
I have IDEA opened 90+% of time, so that might be a culprit 🤔 |
I encountered it a few times again and killing IntelliJ IDEA fixes the issue. It seems that AeroSpace commands are queued because of all the workspace switching I tried to do when it hung are quickly applied after the IDEA is killed. |
The potential fix is to send accessibility requests to different applications from different threads. This way, if one application hangs, it won't affect others. But I don't know whether Apple accessibility API is thread-safe (My intuition says that it's probably not) Also, I'm curious whether yabai/Amethyst have this problem (obviously, if they have this problem, it's not as severe for them, because they use native macOS spaces, but AeroSpace needs to constantly move windows to the bottom right corner back and forth) |
Somewhat related, since it also introduces a noticeable delay: is it possible to execute all commands (such as changing focus or switching workspaces) on key press instead of key release? |
would also be a good idea to "buffer" these commands? so let's say I'm in workspace 1 and I do:
but nothing happens because it's hanging somewhere, so instead of seeing 3 workspace changes after some seconds, just buffer and run the last one? Btw to me happens when I swap to different monitor setup (office => train => home) And I also 8 workspace, 2 intellij products (rider and datagrip) |
I've been getting it quite a bit lately.My cpu is often maxed out at 100%, often by a bash process running in my IDEA terminal, and my window management then has a 4-10s delay. It's easily replicable with
I believe from memory they did, but "spaces" was always fine under heavy cpu load. |
I get this a lot as well. I frequently have high CPU load on my machine and aerospace is very delayed in switching. |
Same here! The 4-10s delays are a real struggle :( Never made the connection to IntelliJ, but can confirm: I daily Goland (it's IntelliJ under the hood) and have been noticing huge slowdowns - potentially as I open more instances(?) - but mostly when I have > 1 monitors connected. |
Just have to run |
Also constant IntelliJ user. Sometimes I notice like 10-15s delay and for some reason quitting Aerospace and reopening does help a bit. |
Lag with intelij running is a lot that it hinders usability. when I switch to a different workspace, I see my background for a few seconds then all the windows render on the workspace. This is also visible when IDEA is not running but it is very quick. |
I've also noticed this issue, and I'm not an Intellij user. Sometimes I can narrow down a specific app (for example I noticed Swift Mail causes a lot of lag), but sometimes I just have Firefox, Wezterm, and Discord open and still get a 5-10 second lag. Restarting Aerospace helps for a while until it comes back. It's a pity to see that issue popping up because I really love Aerospace and have been daily driving it for the past 2-3 months! |
I am able to reliably reproduce the problem. After dealing with the delaying or freezing for my first two or so weeks of using After that couple of weeks without any performance issues I ran my codebase's test suite, which is CPU intensive. Aerospace workspace switching immediately became slow, and remained slow even after my CPU load went back to 1-2%. Once I restarted it aerospace, everything was fast again. Looking back, for the two or so weeks where it was fast I had:
The above suggests that this issue is not directly related to what applications you are running. The slowness begins as soon as you do something CPU intensive, regardless of what application caused it. People are reporting that they notice the problem when running intellij. I suspect that this is because intellij is something that people use to do CPU intensive things. Given that the problem immediately goes away once you restart aerospace, I'm inclined to believe that aerospace is capable of either fixing or working around whatever the problem is. For instance, in the worst case aerospace could detect unusual slowness and do whatever it does when it restarts. (I am not suggesting that this is a good idea, just pointing out one brute force solution). In the best case, we identify what aspects of aerospace could at all be related to this issue, narrow down the root cause, and fix it. In summary:
Performance issues have been on an intel mac.
|
Happens to me regularly with GNU Emacs. Every time it is in blocking operating (it is single thread, so it tends to happen), it is not possible to switch workspaces. Reproduction is trivial, run |
Today I found it goes so far that Activity monitor says Aerospace is not responding and if you hover the menubar item of Aerospace you get the beachball. And you could do zero actions with Aerospace. This happend because IntelliJ somehow also got stuck and had to be force-quit. I even restarted Aerospace (while IntelliJ was still in its broken state) and Aerospace was barely responsive only resizing some windows, switching workplaces didn't work at all. Only fully force quitting IntelliJ brought life back to Aerospace. |
No need to report about applications that block macOS AX API (such as IntelliJ, or Emacs
Related yabai discussions: koekeishiya/yabai#2377 koekeishiya/yabai#599 koekeishiya/yabai#600 Until I have time to dig into this problem, everyone else is welcome to do so |
Same issue here! |
i also have hard time pinpointing what the issue is ...yesterday i had like 3sec freezes switching desktops and closed everything but browser and alacritty and it fixed it. For me its one of (or all combined) BambuStudio, Blender, Spotify desktop. |
I am experiencing the same issues. Not using Intellij but i suspect its due to the Arc browser. Aerospace is snappy in the beginning but quickly gets very, very slow, almost unusable. Restarting Aerospace does the trick. M1 Pro on Sequoia 15.0 Edit; It seems when I disable JankyBorders its working better. Time will tell. |
I think we know what the root of the issue is, based on this comment, the open question at this point is what can be done to solve it. |
If it would fail to be thread safe, maybe it would also be possible to spawn a child process per application and issue AX requests to from that sub-process. Then the main AeroSpace process could queue them work and collect the responses in non-blocking way. I can imagine it would complicate the architecture a lot, but I guess it should work? |
After full working day I can say this did the trick, disabling JankyBorders fixed all issues for me.. |
I experience this issue even without jankyborders. I think the threading thing might be the issue because once I restart my computer aerospace works fine at least until I get a couple apps running for an extended period of time (a few days) then I experience the lag. |
i too see the same, but whenever it starts degrading, all i need to do is close all the apps (excluding terminal and browser) so probably some apps are causing this to be worse but it always fixes it for me. Then its almost instant for days, then there seems to be a point where it suddenly starts degrading again and turns from fraction of second to few seconds. Then closing apps solves it again. |
#131 It probably won't resolve the problem, but it's a low effort commit that should make the situation better, avoiding complete freezes
In 0.15.0, I added a low effort commit to set It won't resolve the problem, but should avoid complete freezes caused by 3rd party apps |
Hi!
Thanks for all the new features.
After updating to 0.8.0, I had AeroSpace disabled before I fixed the config file and I noticed that when AerosSpace is enabled there is a noticeable delay (I have no measurements, but it feels like hundreds of milliseconds at least) when either moving focus or changing workspaces. This also happens when I focus windows via
cmd+tab
, doing this without AeroSpace is instantaneous.I know it's still beta, but I wanted to ask:
I'm on M1 Pro + Sonoma.
I'm not trying to bash AeroSpace - the feature set is great and I use it as a daily driver, but the MacOS felt laggy for a while and now I found out it's only when using AeroSpace and I want to help to make it better.
Note by @nikitabobko
Related: #242
The text was updated successfully, but these errors were encountered: