More mobile apps now run AI on the phone itself, for things like private meeting notes, receipts scanned offline or a summary of a long group chat. The models are small enough to do this. The problems come from the app around them, like a blocked main thread, memory pressure, a 200 MB download over a weak connection, or a phone a few years older than yours.
I built Airtime to see where it breaks. It's an iOS app for in-person meetings. You record a conversation, and the phone works out who spoke when, transcribes it, ranks everyone by talk time and writes a short recap with next steps. No audio leaves the device.
Airtime's three main screens: record or try the sample, analyze on the phone, then the recap with a talk-time leaderboard.
Four models do the AI part, about 285 MB in total: pyannote and WeSpeaker to tell speakers apart, NeMo Citrinet for speech to text, and Liquid's LFM2.5-350M for the recap. The app is monitored with Measure.
TL;DR
- NitroUI let me write a native iOS app in React and TypeScript, with real UIKit views, native navigation, and Swift code called through bindings generated from TypeScript specs. Measure recorded a median warm launch of 447 ms on the release build.
- In 1.0, I called speaker detection as a blocking function from JavaScript. JavaScript runs on the main thread in NitroUI, so the UI froze for about 6 seconds on every recap. Measure recorded an app hang in 5 of 5 runs.
- 1.1 calls the async version of the same Nitro method, which runs on a background queue. It still takes 6.3 seconds, but there were no hangs.
- The fix made each recap about 1.2 seconds slower. The trace showed exactly where that time went.
Built with NitroUI
NitroUI is Margelo's new framework for native iOS and Android apps written in React and TypeScript. The code feels familiar, with JSX, hooks and plain JavaScript, but the runtime underneath works differently.
Your JavaScript runs on the main thread and renders real UIKit views synchronously, which is what makes true native lists possible. Native code is called through Nitro. You describe a module in a TypeScript spec, and the bindings between JavaScript and Swift or Kotlin are generated for you. In release builds, React, its reconciler and the NitroUI renderer are compiled to native code with Static Hermes.
Airtime uses all of that. Every screen is JSX and hooks on top of UIKit views and a native navigation stack. Two Nitro modules carry the native side. AirtimeML wraps the microphone, model downloads, sherpa-onnx and llama.cpp, and MeasureBridge lets JavaScript call the Measure iOS SDK. Nitro callbacks stream diarization progress and language model tokens back to JavaScript while the work runs on background queues, so the Processing screen shows the summary as the model writes it.
A real recording of Airtime, release build on an iPhone 17 Pro Simulator. Every screen is React, rendered as UIKit views.
Measure starts in the app delegate before any JavaScript loads, so it times each launch from the very beginning. Across 11 launches of the release build on an iPhone 17 Pro Simulator, it recorded a median warm launch of 447 ms to first frame.
That main thread detail is important here. In NitroUI your JavaScript runs on it, so a synchronous Nitro method runs there too. Airtime's speaker detection spec has both versions of the call:
diarize( recordingPath: string, speakerCount: number, onProgress: (fraction: number) => void, ): Promise<SpeechSegment[]> diarizeBlocking(recordingPath: string, speakerCount: number): SpeechSegment[] The first one returns a Promise, and its Swift side runs the work on a background queue. The second blocks whatever thread calls it. 1.0 calls the second one, and 1.1 calls the first.
Two versions of the same pipeline
1.0 is written the way a first version usually gets written. It calls diarizeBlocking, loads every model at launch and keeps them in memory, and gives the language model a 32,768-token context.
1.1 calls diarize, loads each model right before its step and frees it after, and drops the context to 4,096 tokens.
I ran each version five times with a bundled 55-second conversation between two people. Each run was a fresh launch of a release build on an iPhone 17 Pro Simulator. Every recap is one trace in Measure, with a span for each step.
How the recap is traced
Measure records crashes, app hangs, URLSession requests, launch time and memory without any extra code. What it can't know is what a "recap" is, so the app adds that from JavaScript through MeasureBridge.
Each recap is one root span, recap, with a child span for every step: model downloads, diarize, transcribe and summarize. Checkpoints mark moments inside a step, like model_loaded and first_token. Attributes carry the numbers worth filtering on later, such as audio length, speaker count, context size, time to first token and tokens per second. The root span also records which policy ran, so 1.0 and 1.1 recaps sit side by side in the same view.
Here's the speaker detection step, trimmed a little:
try { const segments = policy.diarizeOnMainThread ? speech.diarizeBlocking(recording.path, -1) : await speech.diarize(recording.path, -1, onProgress) span.setAttributes({ segments: segments.length, speakers, main_thread: policy.diarizeOnMainThread, }) return segments } finally { if (policy.unloadBetweenStages) speech.unloadDiarizer() } That main_thread attribute made the 1.0 traces easy to read. Every hang started inside a diarize span marked main_thread: true.
All monitoring goes through a small interface, so the tests swap in a fake that records spans and events. The pipeline tests check what Measure would receive, not only what ends up on screen.
The freeze
In 1.0, speaker detection took about 6.4 seconds. For all of that time the screen couldn't redraw or respond to a tap.
One recap from each version, with times from the Measure traces. Speaker detection takes 6.3–6.4 seconds in both. In 1.0 it holds the main thread.
Measure's iOS SDK checks the main thread from a background thread. If the main thread doesn't answer within 2 seconds, Measure records an app hang, with how long the thread was blocked, where, and whether the app recovered or was killed. Two seconds is the default. You can change the threshold remotely, without shipping a build, down to 1 second if shorter stalls matter in your app.
Every 1.0 recap produced one:
- 5 app hangs in 5 recaps
- 6.3 to 6.6 seconds each
- All on the main thread, all recovered
Each hang has a session replay of what the user went through. It shows the Home screen, the recap starting, the Processing screen, the hang about 2 seconds in, and then the Recap screen once speaker detection finishes.
Session replays for the Airtime runs in Measure, with app version, OS and device on every session.
These runs were on a Simulator on an Apple Silicon Mac. On an older iPhone the same call would likely take longer. If iOS ends the app while it's stuck, Measure marks the hang as killed instead of recovered.
In 1.1 speaker detection still takes 6.3 seconds, but the progress screen keeps updating the whole time. Measure recorded no hangs in five runs.
The fix cost 1.2 seconds, and the trace shows where
1.1 is slower. The median recap went from 15.0 seconds to 16.2.
Five recaps per version. 1.1 drops the hangs and the launch preload, and adds two short model loads to every recap.
I didn't have to guess why. In 1.1 the transcription and summary spans each start with a model load of 0.5 to 0.7 seconds, recorded as a checkpoint inside the span. In 1.0 those models were already in memory.
That's a trade I'm happy with. Each recap is a second slower, and the app no longer holds every model in memory for the whole session. 1.0's approach also cost time at launch. Its preload took 0.7 to 1.8 seconds on every plain launch, even when someone only wanted to read an old recap.
The smaller context made no visible difference for a recap this size. Both versions sent the same 569-token prompt, got the first token after about 1.8 seconds, generated about 58 tokens per second on the Simulator's CPU, and wrote three next steps.
What the Simulator can't tell you
Some of 1.0's mistakes only show up on real phones, and these runs didn't catch them:
- Memory: Measure doesn't record available memory in the Simulator, so it can't flag high memory sessions there. On a device, a session is flagged when a reading reaches 75% of the app's estimated memory limit. That's where the 32K context and the preloaded models would show up. Memory is also sampled for a small share of sessions by default, so raise the rate in Adaptive Capture before a test run.
- Downloads: The models were already on the Simulator. On a weak connection, 1.0 restarts the 219 MB language model download from zero after every failure. Measure records each URLSession request with its status, duration and failure reason, so you'd see every retry.
- Readable stacks: The hang stacks showed NitroUI frames as raw addresses, because I hadn't uploaded dSYMs. Small differences in those addresses also split five hangs from one bug into four groups. With symbols they'd show up as one issue.
Uploading dSYMs is a small step in the release build, and it's easy to forget before a first release.
Simply put, the models in 1.0 were fine. Speaker detection ran on the main thread, so every recap froze the screen for six seconds, and Measure flagged it on the very first run.
Airtime is open source under MIT, with both pipeline versions and the full results in the GitHub repo. NitroUI's docs are the place to start if you want to try it.
Measure is open source, built for production apps, and you can host it yourself. Start with the app hang docs or performance tracing.





