gp
Vlad
No worries, it's a fun bit of investigation.
I did a good bit of searching to find some utility to get the current screen refresh rate and came up empty-handed. I did, however, find CVDisplayLinkGetActualOutputVideoRefreshPeriod
which appears to provide the number we are after. I reckon you guys would know how to use this function, but I'm clueless here, my beard is a bit too short!
Unfortunately, the effect of this setting is not instant, the app must be fully restarted for it to take effect. Makes it a bit less useful.
I did the same static and scrolling tests in fullscreen:
Reddit Static FS - 5m
60Hz: 0.618
ProMotion: 0.481
Reddit Scroll/5s FS - 5m
60Hz: 8.896
ProMotion: 10.333
I was scrolling every 5 seconds so powermetrics
sample (which is 5s) got one scroll event. I changed it to scroll every 7.5s, in case having it synchronized with the sampling was doing anything weird.
Reddit Scroll/7.5s FS - 5m
60Hz: 7.074
ProMotion: 7.910
As you'd expect, the overall impact is lower, and the difference between the two is less - less action on the screen overall. Still, the ProMotion setting is worse.
Interestingly, the static test in fullscreen shows a solid improvement in energy impact with the ProMotion setting. The 60Hz is similar but there's a 34% reduction in impact w/ the ProMotion setting vs 60Hz. I guess getting my menubar (which is has constantly updating iStat menus) out of the way is helping.
So it appears that, indeed, fullscreen changes how this works. As I was trawling through trac.webkit.org and various resources related to this stuff, I saw mentions of how fullscreen is needed to get the most out of variable refresh rates (both adaptive sync monitors and ProMotion displays). Makes sense.
I'm calling disabling this experimental setting "ProMotion", but it's actually not that at all, it's just asking webkit to draw close to 60fps. And it should probably just be "60fps" and not "60Hz" - it's only aiming for 60Hz because I'm on a ProMotion display. In the case of a 144Hz monitor, for example, this setting tells webkit to draw at 72Hz. The actual rate is determined by the system and provided via CoreAnimation (iOS/iPadOS/Catalyst) or CoreVideo (macOS) to the application. Some more tidbits:
https://developer.apple.com/videos/play/wwdc2021/10147/
https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro
PS: asitop
(pip3 install asitop
) is a nice terminal UI for powermetrics
, pretty cool.