Obsessing Over 10x

A historical note from an early local Whisper prototype, when I spent two weeks on compiler flags and CoreML to push speed to 10x.

Performance

I'll admit it: I'm obsessed with performance.

Not in a "premature optimization" way—I know the rule. But Reso's entire value proposition is real-time transcription. If it lags, it's useless.

When I first got Whisper.cpp running on Apple Silicon, I was excited. It worked! But then I checked the metrics:

0.12x real-time speed.

Translation: An 8-second audio clip took 66 seconds to transcribe.

That's... not real-time.

The First Breakthrough: CoreML

Whisper has two parts: an encoder (heavy) and a decoder (lighter).

The encoder is what crushes CPUs. But Apple Silicon has a dedicated Neural Engine for exactly this kind of work.

I found a CoreML-compiled version of the Whisper encoder. Adding it was straightforward:
- CPU encoder: 0.12x speed
- CoreML encoder: 3.2x speed

Better! But still not enough. I wanted 10x.

The Second Breakthrough: Compiler Optimization

Here's where it got weird.

Whisper.cpp is written in C++. When you build a Swift app in Xcode, it optimizes Swift code aggressively—but treats C++ dependencies like third-party libraries and barely touches them.

I discovered you can pass custom compiler flags to the C++ build:
``bash
-Xcc -O3 # Max optimization level
-Xcc -flto=thin # Link-time optimization
``

LTO (Link-Time Optimization) is the secret sauce. It analyzes the entire compiled program and inlines functions across file boundaries, eliminating overhead.

After adding these flags:
- Xcode build: 3.2x speed
- Optimized build: 10.6x speed

I nearly fell out of my chair.

The Cost of Knowledge

This isn't documented anywhere obvious. I found it through GitHub issues, compiler flag experiments, and profiling dozens of builds. Two weeks of trial and error.

But the result: Reso transcribes audio faster than you can speak it. On an M2 Pro, an 8-second clip processes in 0.75 seconds.

Why This Matters

Speed isn't just a feature—it changes how you use a tool.

When transcription is instant, you stop thinking about it. You just record, and the text appears.

That's the difference between a tool you use and a tool you forget is even running.

The best tools disappear.