DEV Community

Cover image for Why Most Mac OCR Apps Feel Sluggish (And How Byakugan Scan Fixes It in RAM)
Aritro Saha
Aritro Saha

Posted on

Why Most Mac OCR Apps Feel Sluggish (And How Byakugan Scan Fixes It in RAM)

If you've ever used a screen OCR tool on macOS, you've probably noticed that slight, annoying lag: you drag a box around text in a YouTube video, PDF, or Zoom presentation, release the mouse, and wait 2 to 4 seconds for the text to actually hit your clipboard.

On an Apple Silicon Mac capable of trillions of operations per second, that lag shouldn’t exist.

It turns out the bottleneck isn't Apple's Neural Engine—it's disk I/O.


The Flaw: Writing Temporary Screenshots to Disk

Almost every screen OCR wrapper captures your selection by saving a temporary image file to /tmp, reading it back, and deleting it.

On macOS Sonoma and Sequoia, writing any image to disk immediately alerts OS background daemons:

  • Spotlight (mdwrite) rushes in to index file metadata and thumbnails.
  • MADService (Media Analysis Daemon) starts analyzing the newly dropped image.

Even though the file is tiny, that disk roundtrip can introduce 2-to-5-second stutter stalls.


The Fix: 100% In-Memory Processing (<50ms)

I built Byakugan Scan to rethink the capture pipeline from scratch:

  1. Zero Disk Writes: When you drag the selection box, pixels are piped directly into volatile RAM (NSPasteboard). Nothing ever touches /tmp or the filesystem.
  2. Instant Neural Engine OCR: Apple’s native Vision framework reads the pixel buffer straight from memory, copying recognized text to your clipboard in under 50 milliseconds.
  3. No OS Permission Spams: Uses silent preflight checks (CGPreflightScreenCaptureAccess), so you never get trapped in annoying macOS Screen Recording permission dialog loops.

What Else Is Under the Hood?

  • On-Screen QR & Barcode Scanner: Decodes QR codes (with 1-click URL/Email actions) and 13+ industrial barcodes (EAN, UPC, Code 128, PDF417, Aztec, Data Matrix) right off your display—no phone needed.
  • Floating HUD Pill: Shows word/character counts and quick actions in a sleek frosted-glass toast without cluttering Notification Center.
  • Raycast / Alfred Deep Links: Trigger scans via custom URL schemes (byakugan://scan?mode=text).
  • 100% Offline & Private: Zero network entitlements, zero analytics SDKs, and zero telemetry.

Install via Homebrew

brew install --cask halcyon-past/tap/byakugan-scan
Enter fullscreen mode Exit fullscreen mode

Built and written by Aritro Saha, Software Engineer 1 at Bristol Myers Squibb. Check out more projects and the developer arcade at aritro.cloud.

Top comments (0)