News for hackers. Stuff that matters.
Re:How macOS manages M1 CPU cores by saagarjha on Monday April 25, 2022 @06:49AM (#31152780)
Perhaps you are running into App Nap?
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"];
Re:How macOS manages M1 CPU cores by dave78 on Monday April 25, 2022 @08:14AM (#31153397)
I've used AppNope with success, though I've never tested on an M1.