Post

Replies

Boosts

Views

Activity

How can I prevent WKWebView initialization from hurting app startup time so much?
For many mid and large-size iOS apps, startup time is delayed by 100+ milliseconds due to 1 or more WKWebViews being created. This is usually due to 0-1 WKWebViews being created by first-party code and 1 or more different SDKs each creating their own WKWebView (IIRC for them to use a JS VM). Although SDK providers may not be willing (or able) to defer the creation of these WKWebViews past startup, I'm hopeful that there are still some ways to improve WKWebView creation time, and that I can share those ideas with them. Note that much of the time spent under the hood for WKWebView initialization seems to be on process pool creation and management. My ideas so far are: Defer WKWebView creation. This is an obvious one, but I generally want to look past it because SDKs are often unwilling to defer work like that and because it's going to cause frame drops whenever it does get loaded, even if not at startup. Use a shared WKProcessPool. Many companies wouldn't care all that much about sharing the same process space, so this would be a nice win Create the WKProcessPool or the WKWebViewConfiguration on a background thread (is this even safe to do?) Use some sort of lower-level API to run a JS VM, e.g. through WebKit2 directly, if such a public and stable API exists. Use JavaScriptCore. However, for reasons I can't recall, I believe this was a non-starter. It may have been JavaScriptCore's far slower performance, or the need to render actual web content. What are people's thoughts on these ideas? Does anyone have any other ideas?
0
0
656
Jul ’23
How can I use Superpages on an M1 Mac?
I have a number of performance-intensive tasks that I need to run regularly, such as compiling and linking large programs, and I'd like to see if superpages are of help here. I've had great long-term success with low-level changes to other aspects of the programs, such as the malloc default zone, and would like to see if changing the page size can provide similarly fruitful results. There is some evidence that that may be the case (https://easyperf.net/blog/2022/09/01/Utilizing-Huge-Pages-For-Code#option2-remap-the-code-section-at-runtime and https://xmrig.com/docs/miner/hugepages). However, when I try, mmap(NULL, 2 * 1024 * 1024, PROT_READ, MAP_ANON | MAP_PRIVATE, VM_FLAGS_SUPERPAGE_SIZE_2MB, 0) for example, it always fails. Is there any way to use superpages?
3
0
2.1k
Sep ’22
How can I symbolicate addresses from an xctrace run?
I want to do a recording from the command-line with the Time Profiler, and get symbolicated stack traces from the resulting XML. Everything works for this using xctrace except that the addresses aren't symbolicated. After running xcrun xctrace export --xpath '//trace-toc[1]/run[1]/data[1]/table' ..., I see e.g. <text-addresses id="12397" fmt="frag 923">6915975758 ...</text-addresses>. So I have the addresses but they're not symbolicated. Is there an easy way to symbolicate them like Instruments.app does?
1
2
1.2k
Jun ’21
Provisioning profile issues, even after resets
When I try to run my app on a real phone, after trusting the certificate, I get the following error:iPhone has denied the launch request.Internal launch error: process launch failed: UnspecifiedWhen I click on "Details", I get:DetailsCould not launch “MyApp”Domain: IDEDebugSessionErrorDomainCode: 3Failure Reason: iPhone has denied the launch request.Internal launch error: process launch failed: Unspecified--process launch failed: UnspecifiedDomain: IDEDebugSessionErrorDomainCode: 3--I've tried every reset I can think of: building on both Xcode 10 and 11, building for both iOS 12.4 and 13.0, deleting DerivedData and all other imaginable build caches, deleting all relevant certificates from the keychain, restarting the phone and computer, using a different phone. It feels like it started when I tried building and running an app on one of the phones phone after downgrading it (via a restore) from 13.0 to 12.4, but I'm not sure. I'm using an automatically managed provisioning profile. Any ideas?
5
0
5.0k
Sep ’19