Skip to content

Defer iOS preview, authentication and sidebar startup work - #80

Draft
tiensonqin wants to merge 10 commits into
mainfrom
perf/lambda-cold-start
Draft

tiensonqin wants to merge 10 commits into
mainfrom
perf/lambda-cold-start

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Stored-session startup eagerly loaded preview/browser-authentication UI and an unopened sidebar. This pins LUI's on-demand preview and first-reveal drawer fixes, loads the public AuthenticationServices framework only for interactive sign-in, and keeps the full native navigation, controls, editing and authentication flows.

Corrects two launch-ordering defects: the ready root's opaque background was cleared on another main-queue turn, and the first-content observer could release sidebar loading behind that cover. Reveal now joins the ready root transaction. Sidebar loading waits for a display timestamp corresponding to an uncovered commit. The independent noninteractive logo fade remains unchanged; no timers, prewarming, private runtime overrides or UI omissions are used.

Includes isolated native regressions and an actual-AppMain fresh-process benchmark with the shipping FFI exports, optimized production modules, immutable binary checks, real graph titles and restored authentication. Profiling/CPU-counter observations are kept separate from uninstrumented performance samples.

Validation on current main 651202c:

  • Previously rebuilt OCaml simulator core passed 1,090 tests; native link-input fingerprint 4e5bcf1282b9d0569d086ab3c5964dc869608e97e158f17c8cbdd3a24ccbb21b. This follow-up does not change core source.
  • All 104 direct Swift Testing UI cases and eight native launch checks passed after the ordering fixes, including new actual-root first-transaction and covered-frame/display-clock regressions. New regressions were observed failing before correction.
  • Production Release modules rebuilt without testability; dependency source checksums restored after every discarded prototype. No XCTest or swift test was run.
  • Prior first-frame measurement regression and Release macOS LogseqModel gate passed.

Performance remains unresolved. Earlier seven-pair authentication controls measured 40.7 ms median pre-main saving but only 14.3 ms complete-frame saving. For the ordering follow-up, seven randomized three-way rounds show 64.5 ms paired window-to-content-commit saving, positive in every round, but only 1.9 ms complete-frame saving. An independent seven-pair confirmation shows 59.9 ms earlier content commit (7/7) and 11.6 ms complete-frame saving (4/7). Corrected complete-frame median in that confirmation is 707.1 ms; the 300 ms gate is still red.

Fresh profiles show approximately 34–36 ms of main-thread conformance checks, so the earlier 95 ms category is not a stable removable budget. Another observation finds substantial UIKit trait/layout execution after the earlier commit. Neither background comparison traversal nor an earlier commit can be counted as eliminated critical-path delay. Targeted drawer type boundaries, root tint omission, closed-drawer shadow/material changes, surface routing, padding and asynchronous-load prototypes failed causal controls or replication and were reverted. No experimental implementation from those controls ships.

This PR remains a draft. The extra first-layout cost is not fully explained or fixed. Uses fixes merged in logseq/lui#262, pinned at reviewed revision 3171aeaa. Investigation, rejected controls and raw measurements.

@tiensonqin
tiensonqin force-pushed the perf/lambda-cold-start branch from 29cd79d to 52250db Compare October 23, 2026 19:35
@tiensonqin
tiensonqin force-pushed the perf/lambda-cold-start branch from ab7ea80 to 4ba426f Compare October 23, 2026 20:20
@tiensonqin tiensonqin changed the title Defer iOS preview and sidebar startup work Defer iOS preview, authentication and sidebar startup work Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant