Repository navigation
perf(apple,ios,engine): hint 120Hz ProMotion frame rates, skip FollowBounds reads, release nav symbols, log max frame - #2716
Conversation
f289eeb to
cc32123
Compare
oneo-me
left a comment
There was a problem hiding this comment.
Thanks for digging into iOS navigation performance — the profiling is useful. This can't merge as is, though:
Blocking
-
The iOS target doesn't build.
go tool nsgo check -target iosfails:internal/platform/ios/nav.go:338:3: invalid operation: a.TitleFont != b.TitleFont (struct containing map[string]float32 cannot be compared)Same at
nav.go:339and twice atnav.go:359.driver.Fontholds a map, so it needs a field-wise comparison. CI skipped Build and vet (Apple) because Go formatting failed first. Please rungo tool nsgo check -target ios,macosrather thango teston the host. -
Diffing in
styleLayerBoundloses borders and backgrounds (internal/platform/apple/layer.go:90-112, macOS and iOS). The old code reset the layer's background, corner radius and border width on every call beforeapplyDecoroverrode them, and decor clears them when it draws a shape or a dashed border (decor.go:439,723,727). With the diff, a cleared value is never restored. A local test confirms it: a layer styledBorderWidth: 2, BorderStyle: BorderDashed, then restyled withBorderSolid, ends withborderWidth0 instead of 2. The same test passes on main. The background is lost the same way when a shaped style goes back to plain corners. -
The core change is superseded and conflicts. main already keeps a covered screen's layout through
node.covered(197e075, #2601). TheVisibilityHiddenchange incore/tree.go,core/commit.goandcore/keys.goduplicates it and conflicts incore/tree.goandcore/nav_test.go. Please drop it and rebase onto main. -
gofmt:
internal/platform/apple/layer.go(thevarblock at lines 38-40).
To discuss
setDelaysContentTouches: false(ios/behavior.go:128) departs from UIKit's default: rows and buttons in a scroll view highlight as soon as they're touched, then flash off when the drag starts. A maintainer should decide whether we want that.create()no longer callsdirectTreefor standalone LTR views and leaves them toUIView.appearance, anddirect()dropssetNeedsLayout. Please confirmdirection_native_testpasses on a simulator with an RTL system language.sendSetFramedlopens libobjc a second time. A typedobjc_msgSendbelongs ininternal/platform/apple, likemsgSendFloat64.- Missing a
changelog.d/fragment. - Please split this into focused PRs (frame rate hints, touch delay, nav bar caching, purego hot paths, perf log). The smaller pieces look fine:
maxin the-fpsline, the early return inFollowBounds,SetAnimationFrameRateand releasingb.symbolson delete. They'd be easy to land on their own.
Ran: go tool nsgo check -target ios,macos -jobs 4 (iOS fails, macOS passes) and go tool nsgo test ./core/... ./internal/engine/... ./internal/platform/apple/... (1262 passed). I couldn't reproduce the device benchmarks here.
🤖 Claude Opus 5.5
cc32123 to
3482363
Compare
|
Thanks for the thorough review! I've cleaned up and split #2716 as suggested:
Also left |
3482363 to
7b90eed
Compare
|
Thanks @Heyana — I pushed 8779ba6 on top of your commit to finish the frame rate hints:
Ran: 🤖 Claude Opus 5.5 |
|
This pull request has no valid
Run the checks on the head commit, fill the block in the template, then push or edit the body: this label and comment update on their own. |
Style transitions and modal entrances asked for 120 Hz whatever the screen, capping them on faster external displays. Ask for the screen's highest rate instead, leave the system's choice when it is unknown, and share the range with the macOS display link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8779ba6 to
5cb16e6
Compare
Summary
Scoped down from the original PR per review feedback to keep only the focused, non-controversial changes on top of
main:CAAnimationframe rate hints (internal/platform/apple/layer.go,image.go,framerate_test.go,internal/platform/ios/nav.go):apple.SetAnimationFrameRate(anim, maxFPS)settingCAFrameRateRange(Minimum: min(80, maxFPS), Maximum: maxFPS, Preferred: maxFPS) on route slide animations, modal entrance animations, and layer transitions.FollowBounds(internal/platform/apple/decor.go):CGRectbounds when a layer has neither decor nor ring.internal/platform/ios/ios.go):b.symbolsalongsideb.systemwhen deleting a screen view.-fpslogs (internal/engine/perf.go):max <Frame.Max>alongsideframemean andp95inPerfSnapshot.String().changelog.d/ios-promotion-and-frame-stats.md.Split out / dropped from this PR
core/VisibilityHiddenchanges (already covered bynode.coveredin fix(core): keep the layout of a screen another covers #2601) and rebased ontomain.styleLayerBounddiffing change that caused border/background regressions withdecor.UINavigationBarcaching +puregohot paths (with field-wisedriver.Fontcomparison and sharedlibobjctypedobjc_msgSend) and thedelaysContentTouchesdiscussion into separate focused PRs.Verification
gofmtcleango run ./tools/changelog check— passedgo tool nsgo check -target ios,macos -jobs 4— passed (macos_x64,macos_arm64,ios)go test ./internal/engine/... ./internal/platform/apple/...— passed