mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
perf(mobile): warm WebKit's processes on iOS before the first page opens (#39851)
* perf(mobile): warm WebKit's processes on iOS before the first page opens Builds a blank, non-persistent WKWebView a second after Home has a paired host, so the first page open starts against WebContent, GPU and Network processes already running. A release before the delayed start now makes the start a no-op. Based on #32163 by Jinwoo-H. Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com> * fix(mobile): guard warmUp on older binaries and release the warm view on page failure Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com> --------- Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local> Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
This commit is contained in:
co-authored by
Jinwoo-H
m4air
parent
346dcae485
commit
537d764f58
@@ -7,6 +7,14 @@ public class OrcaMobileWebShellModule: Module {
|
||||
public func definition() -> ModuleDefinition {
|
||||
Name("OrcaMobileWebShell")
|
||||
|
||||
// Home calls this once it has a paired host, so a user with nothing to open pays nothing.
|
||||
Function("warmUp") {
|
||||
// A second's delay keeps the warm-up off the launch's first frames.
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
MobileWebShellWarmUp.start()
|
||||
}
|
||||
}
|
||||
|
||||
AsyncFunction("presentPdf") { (url: URL) in
|
||||
guard let presenter = self.appContext?.utilities?.currentViewController() else {
|
||||
throw PdfPresenterUnavailableException()
|
||||
|
||||
Reference in New Issue
Block a user