Archive for March 1, 2022

Tuesday, March 1, 2022

Running Background Apps on Efficiency Cores

St. Clair Software:

As you can see in the image on the left, App Tamer now displays graphs of P and E core usage as well as overall CPU usage. You’ll get these automatically if you’re running App Tamer on an M1-powered Mac.

[…]

When you click on an app in the process list to change its settings, there’s an additional “Run this app on the CPU’s efficiency cores” checkbox, as you can see in the screenshot below.

I explained the basics of this feature in a previous post. It works like App Tamer’s other CPU-saving capabilities in that it’s applied to an app anytime that app is not frontmost. If you turn on the checkbox for Safari, any time that you leave Safari running in the background while you’re using another app, Safari will be switched to the processor’s E cores. This saves power and leaves the P cores free to handle higher priority tasks.

Previously:

Speeding Up an Initial Local Time Machine Backup

Howard Oakley:

To assess the effect of IOPOL_THROTTLE policy, standardised TMA backups were run with and without the policy in force, on an M1 Pro MBP backing up to an external USB-C/SATA SSD under macOS 12.2.1.

[…]

However, transfer rates during the backup itself showed that turning the policy off resulted in a huge increase in transfer rates[…]

[…]

The big disadvantage of using kernel states to completely disable IOPOL_THROTTLE policy is that this can only be applied globally, which includes I/O for Spotlight indexing, and file synchronisation and other background tasks. While it could be used to great effect to accelerate a large first full backup, leaving the policy disabled in normal circumstances could readily lead to adverse side-effects, in which indexing threads swamp important user storage access.

Previously:

M1 Icestorm Performance and Asymmetric M1 Pro Core Management

Howard Oakley:

At its heart, each M1 chip has a total of eight processor cores, all based on Apple’s development of technology licensed from Arm. Four are described as Performance cores, dubbed Firestorm, and four are Efficiency cores, or Icestorm. These primarily differ in their compromise between performance and power consumption, with Firestorm cores performing in the same class as better Intel cores, and Icestorm delivering lower performance with much less power requirement and heat production.

Howard Oakley (Hacker News):

In real-world use, what are the penalties for processes running on Icestorm rather than Firestorm cores? Here I report one initial comparison, of performance when calculating floating-point dot products, a task which you might not consider a good fit for the Icestorm.

Central to this is my previous observation that different Quality-of-Service (QoS) settings for processes determine which cores they are run on. OperationQueue processes given a QoS of 17 or higher are invariably run by macOS 11 and 12 on Firestorm cores (and can load Icestorms too), while those with a QoS of 9 are invariably run only on Icestorm cores. Those might change in the face of extreme loading of either core pool, but when there are few other active processes it appears consistent.

[…]

Maynard Handley previously commented that Icestorm cores use about 10% of the power (net 25% of energy) of Firestorm cores. For SIMD vector arithmetic, at least, they perform extremely well for their economy.

Howard Oakley:

Most scheduled background activities in macOS are now managed by this combination of DAS and CTS, which has proved itself to be superior to fixed time intervals managed by launchd.

[…]

As I noted above, one of the significant factors when scheduling background activities is the QoS set for that activity. The great majority of these have the minimum QoS, so that when they’re scheduled to run on an M1 Mac, they do so on the Efficiency (Icestorm) cores. That’s why Time Machine backups occur at slightly irregular intervals, and when they do, they occupy the Icestorms and leave the Firestorms free for the user.

Howard Oakley:

I’ve been unable to find any way of ensuring that normal commands and scripts run from Terminal are constrained to the Efficiency cores, although I may well be missing a trick here.

[…]

When inside macOS, running from Swift, Objective-C or an equivalent language, there are several opportunities to set the Quality of Service when running command tools.

[…]

For those who want to try out running commands on different combinations of cores, I’ve made a new version of my exploratory utility DispatchRider, which has previously allowed you to explore running commands using NSBackgroundActivityScheduler and the DAS despatching system.

Howard Oakley:

On paper, the major difference between the M1 and M1 Pro/Max CPUs is core count: the original M1 has a total of eight, half of which are E (Efficiency, Icestorm) and half P (Performance, Firestorm) cores. The M1 Pro and Max have two more cores in total, but redistribute their type to give eight P cores and only 2 E cores. It would be easy to conclude that experience with the first design showed that the E cores were only lightly loaded, so fewer were needed, but delivering better performance to the user merited twice the number of P cores. While that may well be true, you also have to look at how the cores are actually used.

[…]

Taken together, these results show that process allocation to cores in the M1 Pro and Max is carefully managed according to QoS (as in the M1) and between the two groups of P cores. This management aims to keep the second group of P cores unloaded as much as possible, and within each group of P cores loads lower-numbered cores more than higher-numbered. This is very different from the even-balancing seen in symmetric cores, and in the M1.

[…]

There are also interesting implications for developers wishing to optimise performance on multiple cores. With the advent of eight P cores in the M1 Pro/Max, it’s tempting to increase the maximum number of processes which can be used outside of an app’s main process. While this may still lead to improved performance on Intel Macs with more than four cores, the core management of these new chips may limit processes to the first block of four cores. Careful testing is required, both under low overall CPU load and when other processes are already loading that first block. Interpreting the results may be tricky.

Previously:

Apple Says It’s Complying With ACM

Toby Sterling:

The Dutch antitrust regulator on Monday issued a sixth weekly fine of 5 million euro ($5.7 million) against Apple for failure to comply with an order to open its App Store to alternative forms of payment for dating apps in the Netherlands.

Sami Fathi:

In a letter obtained by MacRumors, Apple’s head of compliance, Kyle Andeer, has defended Apple’s plan and said it believes it is fully compliant with the ACM ruling and that Apple has a “consistent and longstanding commitment to compliance in each and every country in which we do business.”

[…]

Apple’s requirement that dating apps submit a different app binary if they wish to use a third-party payment method or redirect users to the web for in-app purchases is “a straightforward prerequisite,” according to Apple. The additional app binary ensures “that Apple complies with its legal obligations in the Netherlands while at the same time having the ability to maintain its standard terms and conditions in the rest of the world,” Apple added.

Apple emphasized in the letter that the practice of employing an additional app binary is not complicated or costly for developers to do.

Florian Mueller:

Practically, we can ignore the difference because the bottom line is that Apple’s position is clearer than ever in light of the letter Reuters reported on earlier today. Apple genuinely believes to be acting in good faith--and I can actually see why.

[…]

I can’t take those news of non-compliance sanctions seriously as long as the ACM, which is not just an antitrust watchdog but also has a broader responsibility for consumer protection, isn’t defending consumers against a pricing scheme under which some reportedly paid fives times more than others for the very same service.

Previously:

Tinder’s Opaque, Unfair Pricing Algorithm

Mozilla:

The research — which spanned five continents — reveals that within a single country, consumers can be quoted up to 31 unique price points for a Tinder Plus subscription. Further, some people are charged up to five times more for the exact same service: In the Netherlands, prices ranged from $4.45 to $25.95. In the U.S., they ranged from $4.99 to $26.99.

Consumers International and Mozilla also determined that Tinder’s personalized pricing algorithm can charge older users more money. On average across the six countries investigated, 30-49 year-olds were charged 65.3% more than 18-29 year-olds. This is occurring even after Tinder faced a $24 million lawsuit for unfair pricing based on age in California.

Florian Mueller:

The Dutch ACM is not just an antitrust enforcement agency. They have a broader mandate, which is why I likened them to the FTC. They do look into all sorts of issues. Now, the problem they are facing here is simply this: people wonder why they are pursuing their Apple case at all, given that it benefits Match Group and a few other foreign companies, but no major Dutch player, and the answer is the “C” in the Autoriteit’s name. The argument is that it’s about Dutch consumers. Now, if there is one huge problem affecting dating-app users in the Netherlands that is worth looking into and addressing, the ACM should follow up on Mozilla and Consumers International’s first-rate investigative work. Those non-profits do the job that organizations like the ACM should be doing in terms of “your tax dollars (or euros) at work.”

[…]

Regrettably, the Tinder pricing scandal is also unhelpful to Epic Games. The Fortnite maker co-founded its Coalition for App Fairness with Match Group and Spotify. It’s bad enough that an amicus brief proposed by the CAF was rejected by the United States Court of Appeals for the Ninth Circuit, the most important regional appeals court in the world--it’s arguably more important to the global economy than almost any national top court. Now a CAF co-founder faces a major credibility problem when it comes to the question of who really overcharges app users.

Damien Petrilli:

Apple could bring this in the Netherland court, to show how shady are dating Apps and how bad it would be without Apple’s control.

However, they can’t because it would backfire: showing how unsafe is the App Store as all dating apps were reviewed and approved.

Previously: