Can you please give a high-level overview of how the benchmarks work? What are they testing? Scrolling speed? Loading time? Layout change?
The only truly interesting test is one that creates a 1 million line document, measures the loading time (extremely fast) and then measures the time it takes to navigate to the final line in the document. This exercises the layout system. It's really fast. On my machine TextKit 1 can do it in about 70 ms, and TextKit 2 in around 10. This isn't quite good enough for 120 fps UI on macOS machines that support it, but it's really close.
Live scrolling and window resize are both things I'm really interested in testing. But, the UI automation framework doesn't, as far as I know, have good ways of driving those interactions. But I may be able to cook something up. Ideas welcome!
The test suite is small, and there are no concrete results. This is because the very first truly stressful test I got to produced terrible results. Instead of continuing, I began investigating that more closely. I also opened up a developer support ticket (distinct from a Feedback) with Apple. Apple got back to me about 3 day later, pointing out a bug in my use of TextKit 2. I'm a long-time TextKit 1 user, and this stuff is new to me. I also write a lot of bugs.
TextKit 1 is a very fast system. But with this problem addressed, TextKit 2 now outperforms it by quite a bit. From a performance perspective, it seems really good so far.
If you have any other questions, let me know!
I am disappointed!
The hope is that an open source extension system will make it much easier to add new languages and improve support for existing ones.
But, I also want to be really clear: if you aren't happy, contact us and we'll try to make it right. If you are willing, I'd also love to hear from you about problems and/or missing features. We prioritize requests from license holders over all others.
and on iOS, the containing app is likely not running (in a GUI context).
Typically, the extension is its own small program bundled within the app. The app can be run by an end user, while the extension can only be invoked via the extension mechanism.
I don't know if it's because they actually hate developers, or they're just bad developers themselves.
---
More on topic, this is an interesting approach to a tricky problem that exploits one of Swift's strengths (a stable ABI) and Apple's tight integration across the system (standardized app installation/structure/store/etc). You expose some functions as an extension/plugin API and other apps can just call them. Neat! IPC kind of sucks!
What could use some more discussion is how if you have two apps running and calling eachother (or being called from eachother), how does that affect the threading model? Are calls scheduled to happen later on the main UI thread, or are they actually coming from a separate process and you need to worry about synchronization if that call affects any kind of state?
I'm sorry to disappoint, but ExtensionKit/Foundation do not make use of any Swift features in the way you describe. It's all just IPC (via XPC), so much of it is useable from ObjC, or even C!
Also, this does not provide a direct app-to-app communication channel. The extensions themselves must be separate executables and run within their own sandbox. I think the extension could communication with its containing app, but the system is not set up to do that. All your scheduling questions are really around how XPC works. The view itself is basically an image within your hosting app, so communication is entirely async to the other process.
ExtensionKit allows you to expose realtime UI or information, coming from an installed app instead of a 3rd party service.
That way you don't have to expose your API or build an SDK. You just have functions in your app that can be invoked.
Also the feature is only provided if the user has that app installed. So the experience is curated.
Basically NSOperation scheduled to a non-concurrent operation queue, where the operation itself is made of async calls.
What would be the recommended approach for doing that with swift concurrency ?
https://github.com/mattmassicotte/Queue