Repository navigation
Reduce Apple UI and scoring work on the main thread - #31
AlexSchmidt1999 wants to merge 6 commits into
Conversation
iPhone measurements, October 16The combined build is running on the owner's iPhone, and the owner reports smoother everyday use. These figures are display-link callback timings from Today. The comparison uses windows entirely beyond the first ten foreground seconds, with sync and training inactive, nominal thermal state and Low Power Mode off:
The median window p95 is 16.7 ms in both selections. The retained archive for the fixed version contains 31 windows across 11 foreground captures, covering approximately 123.24 seconds. Including foreground starts, it records 0.733% late callbacks, 30 intervals over 33 ms and a longest interval of 79.1 ms. The merged October 16 installation, The merged iPhone Release and macOS Debug builds pass. The macOS run completes 2,351 app tests with three skipped and zero failures. The five language-setting tests pass separately in the system language. The shared data consists of aggregate timings and counts. Raw archives, device identifiers, precise session times, preferences and health records stay local. |
|
The follow-up changes are now submitted for upstream review:
The shared call sites in #2761 and #2764, and the lazy-dashboard scope in #2638, also follow the installed build. The combined review tree reproduces installed iPhone commit This fork-only collection is superseded by those upstream PRs. The anonymized measurement report remains available in this PR conversation. |
Foreground rescores merge a full day of heart-rate samples, sort them and calculate Effort and calories on the main actor. This happens during ordinary use, with no training session running. The cache-miss read-and-score block now runs in a utility-priority detached task. Cache access and the result merge stay on the main actor. Owner precedence, query limits, formulas and stored values stay the same.
This fork test PR also retains the earlier performance changes:
AppModelwithout observing every publication. Live screens keep observing the same object. The iPhone tab shell receives its repository as a plain reference, and the Shortcuts import alert subscribes to pending imports.The earlier build-454 archive, retrieved before the day-cycle fix, contains 130 windows from 43 foreground captures, all starting without training. Today has 204.96 sampled seconds and a worst callback interval of 265.7 ms. Trends has 48.20 seconds and a worst of 220.6 ms. Most windows overlap the first ten seconds after returning to the app.
Applying the earlier comparison filters leaves only 34.93 seconds of Today data for build 454, compared with 483.81 seconds for build 453. Late callbacks are 1.232% and 0.418%, respectively. The captures cover different interactions and durations. The retained logs also place long windows near foreground rescores. One pass reports 4.176 seconds elapsed and 4.0 CPU seconds. Its phase timings include database waits.
Local verification:
The device traces also contain substantial SwiftUI graph and rendering work.
The capture report and workout benchmark document the measurements. Raw recordings and preferences stay local. Android is unchanged because this changes Apple execution scheduling without changing analytics or storage formats.
This replaces fork test drafts #28, #29 and #30. Their changes remain separate commits. The PR targets the combined fork review branch, and the existing upstream feature PRs remain separate.
iPhone follow-up, October 16
The owner reports smoother everyday use with the combined build. The Today measurements record 0.026% late callbacks over 64.71 seconds, compared with 0.536% over 860.79 seconds before the day-cycle scheduling change. The worst callback interval falls from 159.6 to 63.4 ms.
The October 16 merge with upstream testing is installed. Its first 6.29 sampled seconds contain 404 callbacks, four late callbacks and zero intervals over 33 ms. The longest interval is 29.2 ms. The linked report contains the source revisions, full counts and sampling method. Raw archives and personal data stay local.