Re:How macOS manages M1 CPU cores
by saagarjha on Monday April 25, 2022 @06:49AM
(#31152780)
Perhaps you are running into App Nap?
[ Parent
| on HN ]
Re:How macOS manages M1 CPU cores
by nyanpasu64 on Monday April 25, 2022 @07:58AM
(#31153274)
Not sure why you're downvoted; you seem to be right! In Activity Monitor's Energy tab, I have to expand Terminal > login > zsh > python, but my python process is shown as App Nap: Yes.
How would I opt a program out of App Nap? Should I trust https://pypi.org/project/appnope/?
Re:How macOS manages M1 CPU cores
by jamesfmilne on Monday April 25, 2022 @04:13PM
(#31159947)
This is how you do it from Objective-C:
// Call NSProcessInfo to disable AppNap et al.
NSActivityOptions activityOptions =
NSActivityIdleDisplaySleepDisabled |
NSActivityIdleSystemSleepDisabled |
NSActivityLatencyCritical;
NSProcessInfo* procInfo = [NSProcessInfo processInfo];
m_NoSleepActivity = [procInfo beginActivityWithOptions:activityOptions reason:@"Running some stuff"];