2

If I use the CPU heavily while charging a Mac, how much slower will the charging be? It would be interesting to hear if someone has data how many minutes it takes to:

  1. Charge 0-100% while using ~0% CPU
  2. Charge 0-100% while using 100% CPU

PS! Another interesting question (probably a separate question) would be: If a heavy 100% CPU job takes 1 hour on a 100% charged machine, how long does it take on a charging machine?

bmike
  • 235,889
forthrin
  • 2,631
  • The second question is trivial and addressed in the answer. CPU gets all the power it wants. Charging or not doesn’t affect performance. – bmike Jan 23 '19 at 12:21
  • Not sure what kind of answers you expect here. A system under load needs more power than an idle one, so of course charging is faster if the system is idle. But CPU is only one place where power is consumed, there is also memory, the GPU, disk access on HDD or SDD, network access etc. Don‘t see a meaningful answer here. – nohillside Jan 23 '19 at 16:25
  • You can check the battery amperage (charging or discharging) in System Information - Power - Batter Information. – amdyes Jan 25 '19 at 09:24

2 Answers2

3

The CPU is boss of the power scheme and will get all the power it requests. The charger is boss of the maximum power it will output.

  • In practice, only thermal conditions throttle the CPU when it doesn't decide to throttle itself when there's not enough work to do.
  • If the charger is offering more power to be delivered than the charging controller is being asked to provide to the CPU, you have excess power available.
  • When the battery needs replenishment and excess power is available, the energy will be applied there in the usual non-linear LiPo charge curve off fast charge to roughly 80 percent capacity then slow charge.
  • Newer iOS / iPadOS / macOS systems will delay charging in several cases where you opt in for slower charging in exchange for longer service life (overnight / when local power costs high / when it knows it can slow walk the charge and still be topped off / when you keep the device almost always on charge)

Back to charging, the CPU can pull from two sources and the charger can deliver to two sources.

It’s a pretty simple systematic first glance, but the nonlinear charge and variable CPU/GPU loads make some linear time estimates (or back of the envelope manual calculations) not match reality.

If your charger is not providing the power needed to keep the CPU fully powered, the battery will drain and eventually the Mac will shut off because there’s no more battery to make up the deficit in power. And that is why the CPU can run at full speed.

I don’t think there is any general common timing even if you restrict yourself to only USB-C charging models. But, the great news is you can just open the terminal and check the current power budget and time estimates and not rely on me or anyone else rule of thumb on the internet.

 pmset -g sysloadlog
 pmset -g thermlog
 pmset -g pslog

Those three commands show engineering summaries and details for the overview of the system state (sysloadlog) and the thermal CPU throttling (thermlog). The last power log will answer the specifics of any charge scenario for any model Mac and the charger you have connected.

Apple Silicon has slightly different power measurements. Try these two commands to start if you want to look at power / performance.

sudo powermetrics -s cpu_power,gpu_power
sudo powermetrics -s thermal
bmike
  • 235,889
  • The question is in a situation where the Mac is charging (ie. connected to a charger), thus the following sentence seems out of place: "The battery will drain and the Mac will shut off". – forthrin Jan 23 '19 at 11:09
  • @forthrin I am saying you can provide a charger that doesn’t have the wattage to keep the CPU running. The CPU can drain the battery entirely while connected to power depending on which model of MacBook Pro and which specific charger you have chosen. – bmike Jan 23 '19 at 11:17
  • This is also an example of why site norms are to only ask one question per question. When there’s only one question, then the answer can adequately address it. When you ask multiple questions you might not get all the answers you want – bmike Jan 23 '19 at 11:18
  • After some consideration I tend to agree and thus rewrote the question. – forthrin Jan 23 '19 at 11:37
  • Awesome refinement @forthrin - what model year and specification of Mac and what charger is in play? A MacBook with a 29 watt USB C charger will behave differently than a MacBook Pro 13 touchbar. The GPU also matters when there are two of them, so you’ll get a different power budget connected to an external display and running some but not all programs. – bmike Jan 23 '19 at 12:06
  • Very interesting command line instructions! Didn't know about those. Thanks for pointing them out. – forthrin Jan 25 '19 at 10:43
  • My pleasure @forthrin There's some good information in a new thread over here in case you missed it. – bmike Dec 05 '22 at 16:37
  • The premise of this answer is not entirely correct. It is not the CPU that is the "boss of the power scheme" of charging. That is ultimatively the battery charging controller. The battery can be charged even when the CPU is completely turned off. The components surrounding the CPU on the main board can override the CPUs own "wishes" in terms of power draws as well - for example by slightly lowering the voltage delivered to the CPU. – jksoegaard Dec 05 '22 at 22:46
  • Would boss of the power budget make it more entirely correct @jksoegaard or do you consider it the variable power budget? I consider parts that throttle the power on the main board all being CPU - since they exist only to manage that function, no? – bmike Dec 06 '22 at 00:57
  • I don't think any of those terms are applicable here, no. Considering those parts as being CPU would be highly unusual, and that would be the opposite of established literature. Ofcourse the CPU is the central processing unit only - not various microprocessors and other ICs on the main board. – jksoegaard Dec 06 '22 at 08:20
0

This question is impossible to answer in the general. There simply does not exist such general timings.

Basically a battery has a certain capacity for charge - usually rated in "watt hours" (Wh) or "milli-amp hours" (mAh). Essentially it contains a specific amount of energy. A new 16" MacBook Pro has a battery that is roughly able to hold 100 Wh (watt-hours).

A charger is able to constantly deliver a certain, maximum amount of energy. This is usually rated in watts. So a 100 watt charger that is charging the battery at maximum capacity for 1 hour will deliver 100 watt-hours.

It is not however so that the computer necessarily draws the maximum possible amount of power from the charger at all times. For example newer MacBook Pros support fast charging - the same 16" MacBook Pro can do Fast Charging off a 140W charger. That allows it to reach up to a 50% charge in 30 minutes.

The battery charger controller in the computer decides how much power is drawn from the charger. In the same 16" MacBook Pro, that is handled by a Renesas ISL9240 IC. It is able to very precisely decide how many milliamps to draw at a specific time.

The battery charger controller is instructed on this by an on-board microprocessor. The decisions take into accounts various factors such as a simple timers, temperature sensors, etc. If you charge the battery today and tomorrow - it might not follow the exact same pattern every time.

Now to all this add the fact that the computer is drawing power from the battery while you're charging. Even when the CPU is at 0% load, the computer is still drawing a lot of power from the battery. The CPU also requires power at idle, but a lot of other components are continously powered as well - such as for example the display, memory, wireless interfaces, etc.

The amount of powered drawn is relatively unpredictable. It is not something you can generalize to any system.

So all in all, you might see in some instances that charging a battery from 0-100% takes the exact same amount of time when the CPU is loaded 0% as when it is loaded 100%. In order instances it will take a lot longer in the latter case - with the extreme being that that the battery never reaches 100% when the computer draws more power than is being delivered by the charger.

jksoegaard
  • 77,783