Moving the mouse cursor can cause CPU spikes on macOS
mmazzarolo.com
Moving the mouse cursor can cause CPU spikes on macOS
1–10 of 28 posts
Re: Moving the mouse cursor can cause CPU spikes on macOS
#2It's just another manifestation of mobile is important and desktop can go hang.
You need to spin up when a human puts their finger on the touchscreen so you can have all the nifty animations and indications.
When the "cursor" isn't moving, you want to go to sleep to save battery.
Nobody cares that this isn't relevant when you have a mouse and monitor on a plugged in desktop.
Re: Moving the mouse cursor can cause CPU spikes on macOS
#3Re: Moving the mouse cursor can cause CPU spikes on macOS
#4Re: Moving the mouse cursor can cause CPU spikes on macOS
#5Re: Moving the mouse cursor can cause CPU spikes on macOS
#6Hm, minimum OS scheduler timestep is usually around 1000hz, right? How do gaming mice go above that? I’ve seen up to 8000hz..
while (stillRunning) {
event = getEventOrWait();
// handle event
}
(In macOS this is done inside [NSApp run], but Windows and Linux make the loop explicit.)I think the 1000 Hz you are thinking of is the accuracy of the UI timers. Since you're just calling this in a loop, not waiting for a timer to fire, you can burn through a lot of events in one timeslice. And since most systems have multiple processors, it is reasonable for your game to be running continually, especially since modern OSes frequently prioritize certain kinds of programs (and a game might request prioritization if at all possible).
Re: Moving the mouse cursor can cause CPU spikes on macOS
#7Re: Moving the mouse cursor can cause CPU spikes on macOS
#8I suspect this is at least part of the reason why some people have mysterious performance problems with VirtualBox on macOS[0]—at least, it’s how I first noticed the problem. (I’m sure VirtualBox has some other issue going on too, since its event queue gets backed up so badly that even keyboard events become delayed. Life gets interesting when the delays are so long that the guest OS key repeat is triggered!)
Does anyone know of some small utility that adjusts mouse polling rates to at least mitigate the issue? The official Logitech software to do this is 476MB, 5 kernel extensions, and a launch daemon, which is a bit much just to send a USB command.
Re: Moving the mouse cursor can cause CPU spikes on macOS
#9I recently learned that moving my mouse was causing the coil whine sound coming from my Win10 gaming PC. Turning down the polling rate on my mouse was the only fix that worked.
I’ll have to look at the polling rate thing, too - thanks for the tip.
Re: Moving the mouse cursor can cause CPU spikes on macOS
#10I recently learned that moving my mouse was causing the coil whine sound coming from my Win10 gaming PC. Turning down the polling rate on my mouse was the only fix that worked.
I started getting coil whine yesterday, after adjusting my fan curves. Not really sure why, but with the fans off the whine was far louder than keeping them on a low-speed minimum. It’s not fan noise blocking out the coil whine, because I still can’t hear the fans (they’re Noctua’s). I don’t know if it’s due to thermals, something to do with the power load, or what. I’ll have to look at the polling rate thing, too -…